Class AbstractMockitoVerification<M,​P>

    • Field Detail

      • mock

        protected final M mock
      • argumentCaptor

        protected final org.mockito.ArgumentCaptor<P> argumentCaptor
    • Constructor Detail

      • AbstractMockitoVerification

        public AbstractMockitoVerification​(M mock,
                                           Class<P> parameterType)
        Create new instance.
        Parameters:
        mock - the wrapped mock (has to be either JavaDelegate, TaskListener or ExecutionListener.
        parameterType - the parameter the main method (execute() or notify() expects, one of either DelegateExecution or DelegateTask.
    • Method Detail

      • executed

        public final org.mockito.ArgumentCaptor<P> executed​(org.mockito.verification.VerificationMode verificationMode)
        Specified by:
        executed in interface MockitoVerification<M>
      • doVerify

        protected abstract void doVerify​(org.mockito.verification.VerificationMode verificationMode)
                                  throws Exception
        The concrete implementation must implement the method call (verify(mock).METHOD_CALL(argumentCaptor.capture)).
        Parameters:
        verificationMode - defaults to times(1), but any VerificationMode can be used.
        Throws:
        Exception - just in case the METHOD_CALL throws an exception. If caught, it is propagated unchecked.