do Return
Sets a value to be returned when the stubbed method/function is being called. E.g:
whenever { mock.someMethod() } doReturn 10This function is an alias for Mockito's OngoingStubbing.thenReturn.
Return
OngoingStubbing object used to stub fluently. Do not create a reference to this returned object.
Parameters
return value for the method/function invocation.
Sets values to be returned when the stubbed method/function is being called consecutively. E.g:
whenever { mock.someMethod() }.doReturn(10, 20)You can specify values to be returned on consecutive invocations. In that case the last value determines the behavior of further consecutive invocations.
This function is an alias for Mockito's OngoingStubbing.thenReturn.
Return
OngoingStubbing object used to stub fluently. Do not create a reference to this returned object.
Parameters
return value for the first method/function invocation.
return values for the next method/function invocations.
Sets a value to be returned, to be applied in reverse stubbing.
Example:
doReturn(10).whenever(mock).someMethod()This function is an alias for Mockito's Mockito.doReturn.
See examples in javadoc for Mockito class
Return
Stubber object used to stub fluently.
Parameters
return value for the method/function invocation.
Sets values to be returned on consecutive invocations, to be applied in reverse stubbing.
Example:
doReturn(10, 20).whenever(mock).someMethod()This function is an alias for Mockito's Mockito.doReturn.
See examples in javadoc for Mockito class
Return
Stubber object used to stub fluently.
Parameters
return value for the first method/function invocation.
return values for the next method/function invocations.