Class 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 Detail

      • JavaDelegateAnswer

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

      • 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