Package org.mockito.internal.stubbing
Class OngoingStubbingImpl<T>
java.lang.Object
org.mockito.internal.stubbing.BaseStubbing<T>
org.mockito.internal.stubbing.OngoingStubbingImpl<T>
- All Implemented Interfaces:
OngoingStubbing<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setStrictness
(Strictness strictness) thenAnswer
(Answer<?> answer) Sets a generic Answer for the method.Methods inherited from class org.mockito.internal.stubbing.BaseStubbing
getMock, then, thenCallRealMethod, thenReturn, thenReturn, thenThrow, thenThrow, thenThrow
-
Constructor Details
-
OngoingStubbingImpl
-
-
Method Details
-
thenAnswer
Description copied from interface:OngoingStubbing
Sets a generic Answer for the method. E.g:when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() { public Integer answer(InvocationOnMock invocation) throws Throwable { return (Integer) invocation.getArguments()[0]; } }
- Parameters:
answer
- the custom answer to execute.- Returns:
- object that allows stubbing consecutive calls
-
getRegisteredInvocations
-
setStrictness
-