public class OngoingStubbingImpl<T> extends BaseStubbing<T>
Modifier and Type | Field and Description |
---|---|
private InvocationContainerImpl |
invocationContainer |
private Strictness |
strictness |
Constructor and Description |
---|
OngoingStubbingImpl(InvocationContainerImpl invocationContainer) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Invocation> |
getRegisteredInvocations() |
void |
setStrictness(Strictness strictness) |
OngoingStubbing<T> |
thenAnswer(Answer<?> answer)
Sets a generic Answer for the method.
|
getMock, then, thenCallRealMethod, thenReturn, thenReturn, thenThrow, thenThrow, thenThrow
private final InvocationContainerImpl invocationContainer
private Strictness strictness
public OngoingStubbingImpl(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.public java.util.List<Invocation> getRegisteredInvocations()
public void setStrictness(Strictness strictness)