uhe
10/23/2017, 4:49 PMinterface SuspendingInterface {
suspend fun foo(a: Int): Int
}
@test
fun suspendTest() = runBlocking<Unit> {
val theMock = mock<SuspendingInterface>()
/**
* Next line will fail with:
* Invalid use of argument matchers!
* 2 matchers expected, 1 recorded:
*/
whenever(theMock.foo(any())).thenReturn(10)
}
Apparently using matchers doesn't work properly with suspend functions? I recall some stuff being added to mockito to support this...