mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.11k stars 201 forks source link

Mocking matching lambda argument in method signature #290

Closed devdavidkarlsson closed 6 years ago

devdavidkarlsson commented 6 years ago

Is it possible to mock a method that has a lambda argument, such as the session methods of com.github.andrewoma.kwery.core.

any() does not work for the mapper of select: mapper: (Row) -> R)

screen shot 2018-09-19 at 09 41 19

https://stackoverflow.com/questions/52389446/how-to-mock-match-lambda-in-kotlin-method-signature

devdavidkarlsson commented 6 years ago

Responded to on SO, need to specify type on any to match the lambda signature any<(TypeIn) -> TypeOut>()