on Blocking
Deprecated
Use on { methodCall } instead
Enables stubbing methods/function calls. In case of Kotlin function calls, these can be either synchronous or suspendable function calls.
Simply put: "on a call to the x function then return y".
Examples:
stubbing(mock) {
onBlocking { mock.someFunction() } doReturn 10
}Content copied to clipboard
This is a deprecated alias for on. Please use on instead.
Return
OngoingStubbing object used to stub fluently. Do not create a reference to this returned object.
Parameters
method Call
(regular or suspendable) lambda, wrapping the function call to be stubbed.