In java we would do the following:
verify(myTestObject).execute(any(Callback.class))
In kotlin if I use any(Callback::class) I get "too many arguments for public fun any(): T defined in com.nhaarman.mockitokotlin2".
You have to specify the class as generic type argument:
verify(myTestObject).execute(any<Callback>())
Or, due to type inference, you can leave it out:
verify(myTestObject).execute(any())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With