public class ConsecutiveStubbing<T> extends BaseStubbing<T>
Constructor and Description |
---|
ConsecutiveStubbing(InvocationContainerImpl invocationContainerImpl) |
Modifier and Type | Method and Description |
---|---|
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.
|
thenCallRealMethod, thenReturn, thenReturn, thenThrow, toReturn, toThrow
public ConsecutiveStubbing(InvocationContainerImpl invocationContainerImpl)
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.Copyright © 2018. All rights reserved.