Class JavaDelegateAnswer

java.lang.Object
org.camunda.community.mockito.answer.JavaDelegateAnswer
All Implemented Interfaces:
org.camunda.bpm.engine.delegate.JavaDelegate, org.mockito.stubbing.Answer<Void>

public class JavaDelegateAnswer extends Object implements org.camunda.bpm.engine.delegate.JavaDelegate
This is a specialized Answer that delegates to the given JavaDelegate. When using an JavaDelegate-Mock, this Answer can be used to implement internal behavior of the mock by delegating the method call to the given delegate instance.
Author:
Jan Galinski, Holisticon AG
  • Constructor Summary

    Constructors
    Constructor
    Description
    JavaDelegateAnswer(org.camunda.bpm.engine.delegate.JavaDelegate javaDelegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    answer(org.camunda.bpm.engine.delegate.DelegateExecution delegateExecution)
    Every implementing class must define what "answer" should actually do.
    final Void
    answer(org.mockito.invocation.InvocationOnMock invocation)
     
    void
    execute(org.camunda.bpm.engine.delegate.DelegateExecution execution)
     

    Methods inherited from class java.lang.Object

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

    • JavaDelegateAnswer

      public JavaDelegateAnswer(org.camunda.bpm.engine.delegate.JavaDelegate javaDelegate)
  • Method Details

    • execute

      public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
      Specified by:
      execute in interface org.camunda.bpm.engine.delegate.JavaDelegate
      Throws:
      Exception
    • answer

      protected void answer(org.camunda.bpm.engine.delegate.DelegateExecution delegateExecution) throws Exception
      Every implementing class must define what "answer" should actually do.
      Parameters:
      delegateExecution - either DelegateTask or DelegateExecution.
      Throws:
      Exception - when anything fails
    • answer

      public final Void answer(org.mockito.invocation.InvocationOnMock invocation) throws Throwable
      Specified by:
      answer in interface org.mockito.stubbing.Answer<T extends org.camunda.bpm.engine.delegate.VariableScope>
      Throws:
      Throwable