do Answer
Sets a generic answer to be applied when the stubbed method/function is being called. E.g:
val answer = Answer { "result" }
whenever { mock.someFunction() } doAnswer answerThis function is an alias for Mockito's OngoingStubbing.thenAnswer.
Return
OngoingStubbing object used to stub fluently. Do not create a reference to this returned object.
Parameters
to be applied on the method/function invocation.
Sets an answer to be applied when the stubbed method/function is being called, specified by a lambda. E.g:
whenever { mock.someFunction() } doAnswer { "result" }This function is an alias for Mockito's OngoingStubbing.thenAnswer.
Return
OngoingStubbing object used to stub fluently. Do not create a reference to this returned object.
Parameters
to be applied on the method/function invocation.
Sets a generic answer, specified with a lambda, to be applied in reverse stubbing.
Example:
doAnswer { "result" }.whenever(mock).someMethod()This function is an alias for Mockito's Mockito.doAnswer.
See examples in javadoc for Mockito class
Return
Stubber object used to stub fluently.
Parameters
to answer to apply when the stubbed method/function is being called.