do Return Consecutively
Sets values to be returned when the stubbed method/function is being called consecutively. E.g:
whenever { mock.someMethod() }.doReturnConsecutively(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 values to be returned when the stubbed method/function is being called consecutively. E.g:
whenever { mock.someMethod() } doReturnConsecutively listOf(10, 20)The last value in values 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 values for the consecutive method/function invocations.