public class ConsecutiveStubbing<T> extends BaseStubbing<T>
Modifier and Type | Field and Description |
---|---|
private InvocationContainerImpl |
invocationContainer |
Constructor and Description |
---|
ConsecutiveStubbing(InvocationContainerImpl invocationContainer) |
Modifier and Type | Method and Description |
---|---|
OngoingStubbing<T> |
thenAnswer(Answer<?> answer)
Sets a generic Answer for the method.
|
getMock, then, thenCallRealMethod, thenReturn, thenReturn, thenThrow, thenThrow, thenThrow
private final InvocationContainerImpl invocationContainer
ConsecutiveStubbing(InvocationContainerImpl invocationContainer)
public OngoingStubbing<T> thenAnswer(Answer<?> answer)
OngoingStubbing
when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() {
public Integer answer(InvocationOnMock invocation) throws Throwable {
return (Integer) invocation.getArguments()[0];
}
}
answer
- the custom answer to execute.