Class AbstractMockitoVerification<M,P>

java.lang.Object
org.camunda.community.mockito.verify.AbstractMockitoVerification<M,P>
Type Parameters:
M - type of the mock Delegate
P - type of the simple argument the verified method takes
All Implemented Interfaces:
MockitoVerification<P>
Direct Known Subclasses:
ExecutionListenerVerification, JavaDelegateVerification, TaskListenerVerification

public abstract class AbstractMockitoVerification<M,P> extends Object implements MockitoVerification<P>
Base implementation of MockitoVerification.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.mockito.ArgumentCaptor<P>
     
    protected final M
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractMockitoVerification(M mock, Class<P> parameterType)
    Create new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    doVerify(org.mockito.verification.VerificationMode verificationMode)
    The concrete implementation must implement the method call (verify(mock).METHOD_CALL(argumentCaptor.capture)).
    final org.mockito.ArgumentCaptor<P>
     
    final org.mockito.ArgumentCaptor<P>
    executed(org.mockito.verification.VerificationMode verificationMode)
     
    org.mockito.ArgumentCaptor<P>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mock

      protected final M mock
    • argumentCaptor

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

    • 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 Details

    • executed

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

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

      public org.mockito.ArgumentCaptor<P> executedNever()
      Specified by:
      executedNever 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.