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>
public class ConsecutiveStubbing<T> extends BaseStubbing<T>
-
-
Field Summary
Fields Modifier and Type Field Description private InvocationContainerImpl
invocationContainer
-
Constructor Summary
Constructors Constructor Description ConsecutiveStubbing(InvocationContainerImpl invocationContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OngoingStubbing<T>
thenAnswer(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
-
-
-
-
Field Detail
-
invocationContainer
private final InvocationContainerImpl invocationContainer
-
-
Constructor Detail
-
ConsecutiveStubbing
ConsecutiveStubbing(InvocationContainerImpl invocationContainer)
-
-
Method Detail
-
thenAnswer
public OngoingStubbing<T> thenAnswer(Answer<?> answer)
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
-
-