Class OngoingStubbingImpl<T>

java.lang.Object
org.mockito.internal.stubbing.BaseStubbing<T>
org.mockito.internal.stubbing.OngoingStubbingImpl<T>
All Implemented Interfaces:
OngoingStubbing<T>

public class OngoingStubbingImpl<T> extends BaseStubbing<T>
  • Constructor Details

  • Method Details

    • thenAnswer

      public OngoingStubbing<T> thenAnswer(Answer<?> answer)
      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

      public List<Invocation> getRegisteredInvocations()
    • setStrictness

      public void setStrictness(Strictness strictness)