-
Notifications
You must be signed in to change notification settings - Fork 206
Closed
Description
It seems that if you try to use "matchers" (any, eq, etc.) on suspend function mockito fails with "InvalidUseOfMatchersException".
following test
@Test
fun otherTest() {
val foo: Foo = mock {
on { runBlocking { bar(any()) } } doReturn ("message")
}
Mockito.validateMockitoUsage()
}with following interface definition
interface Foo {
suspend fun bar(arg: String): String
}produces following error
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!
2 matchers expected, 1 recorded:
-> at org.app.Tests$otherTest$i$1$1$1.doResume(Tests.kt:76)
takahirom, cwalcott, kleinwareio, ariedov, pablobaldez and 10 more
Metadata
Metadata
Assignees
Labels
No labels