I am trying to mock a suspend function using mocki...
# coroutines
n
I am trying to mock a suspend function using mockito and argumentMatchers like this
given(mock.suspendFun(any<MyClass>()).willReturn(a)
but i am getting
Copy code
java.lang.IllegalStateException: any<MyClass>() must not be null

	at ...$...$1.doResume(Test.kt:46)
	at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54)
	at kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run(Dispatched.kt:161)
	at kotlinx.coroutines.experimental.DispatchedContinuation.run(Dispatched.kt:25)
	at kotlinx.coroutines.experimental.EventLoopBase.processNextEvent(EventLoop.kt:147)
	at kotlinx.coroutines.experimental.BlockingCoroutine.joinBlocking(Builders.kt:241)
	at kotlinx.coroutines.experimental.BuildersKt.runBlocking(Builders.kt:182)
	at kotlinx.coroutines.experimental.BuildersKt.runBlocking$default(Builders.kt:172)