I have code in Kotlin
and test code in Java
. Since Kotlin
and Mockito
aren't best friends, I haven't migrated test code to Kotlin
.
In Kotlin
I have methods with block types. For example:
open fun getProductInfo(resultListener: (List<Deal>)->Unit, errorListener: (Throwable)->Unit)
{
...
}
Now I want to stub this method in Java
tests. What's the java equivalent of the types? In other words, what should I write in place of ???s below:
doAnswer(invocation -> {
??? resultListener = (???) invocation.getArguments()[0];
// call back resultListener
return null;
}).when(api).getProductInfo(any(), any());