public class OngoingStubbingImpl<T> extends BaseStubbing<T>
Constructor and Description |
---|
OngoingStubbingImpl(InvocationContainerImpl invocationContainerImpl) |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
getRegisteredInvocations() |
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 OngoingStubbingImpl(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.public List<Invocation> getRegisteredInvocations()
Copyright © 2018. All rights reserved.