|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockito.internal.stubbing.BaseStubbing<T>
org.mockito.internal.stubbing.ConsecutiveStubbing<T>
public class ConsecutiveStubbing<T>
| Constructor Summary | |
|---|---|
ConsecutiveStubbing(InvocationContainerImpl invocationContainerImpl)
|
|
| Method Summary | |
|---|---|
OngoingStubbing<T> |
thenAnswer(Answer<?> answer)
Sets a generic Answer for the method. |
DeprecatedOngoingStubbing<T> |
toAnswer(Answer<?> answer)
Set a generic Answer for the stubbed method. |
| Methods inherited from class org.mockito.internal.stubbing.BaseStubbing |
|---|
thenCallRealMethod, thenReturn, thenReturn, thenThrow, toReturn, toThrow |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConsecutiveStubbing(InvocationContainerImpl invocationContainerImpl)
| Method Detail |
|---|
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 DeprecatedOngoingStubbing<T> toAnswer(Answer<?> answer)
DeprecatedOngoingStubbing
stub(mock.someMethod(10)).toAnswer(new Answer<Integer>() {
public Integer answer(InvocationOnMock invocation) throws Throwable {
return (Integer) invocation.getArguments()[0];
}
}
answer - the custom answer to execute.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||