Package org.mockito.internal.stubbing
Class ConsecutiveStubbing<T>
java.lang.Object
org.mockito.internal.stubbing.BaseStubbing<T>
org.mockito.internal.stubbing.ConsecutiveStubbing<T>
- All Implemented Interfaces:
OngoingStubbing<T>
-
Method Summary
Modifier and TypeMethodDescriptionthenAnswer
(Answer<?> answer) Sets a generic Answer for the method.Methods inherited from class org.mockito.internal.stubbing.BaseStubbing
getMock, then, thenCallRealMethod, thenReturn, thenReturn, thenThrow, thenThrow, thenThrow
-
Method Details
-
thenAnswer
Description copied from interface:OngoingStubbing
Sets a generic Answer for the method. E.g:when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() { public Integer answer(InvocationOnMock invocation) throws Throwable { return (Integer) invocation.getArguments()[0]; } }
- Parameters:
answer
- the custom answer to execute.- Returns:
- object that allows stubbing consecutive calls
-