Class TaskListenerAnswer

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

public class TaskListenerAnswer extends Object implements org.camunda.bpm.engine.delegate.TaskListener
This is a specialized Answer that delegates to the given TaskListener. When using an TaskListener-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
  • Field Summary

    Fields inherited from interface org.camunda.bpm.engine.delegate.TaskListener

    EVENTNAME_ASSIGNMENT, EVENTNAME_COMPLETE, EVENTNAME_CREATE, EVENTNAME_DELETE, EVENTNAME_TIMEOUT, EVENTNAME_UPDATE
  • Constructor Summary

    Constructors
    Constructor
    Description
    TaskListenerAnswer(org.camunda.bpm.engine.delegate.TaskListener taskListener)
     
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • TaskListenerAnswer

      public TaskListenerAnswer(org.camunda.bpm.engine.delegate.TaskListener taskListener)
  • Method Details

    • notify

      public void notify(org.camunda.bpm.engine.delegate.DelegateTask delegateTask)
      Specified by:
      notify in interface org.camunda.bpm.engine.delegate.TaskListener
    • answer

      protected void answer(org.camunda.bpm.engine.delegate.DelegateTask delegateTask) throws Exception
      Every implementing class must define what "answer" should actually do.
      Parameters:
      delegateTask - 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