Class CallActivityMockForSpringContext

java.lang.Object
org.camunda.community.mockito.process.CallActivityMock
org.camunda.community.mockito.process.CallActivityMockForSpringContext
All Implemented Interfaces:
DeployProcess.BpmnModelInstanceResource

public class CallActivityMockForSpringContext extends CallActivityMock
Implementation that registers the delegates mocks for the mocked subprocess to the gived spring bean context.
  • Constructor Details

    • CallActivityMockForSpringContext

      public CallActivityMockForSpringContext(String processId, CallActivityMock.MockedModelConfigurer modelConfigurer, org.springframework.beans.factory.config.SingletonBeanRegistry springBeanRegistry)
      Parameters:
      processId - Process definition key of the subprocess to mock. This should be the value of the 'called element' attribute of the mocked CallActivity element.
      modelConfigurer - Object that allows to customize the mock process model for the subprocess
      springBeanRegistry - Spring context to place the implementations of the activities in the mocked process to
    • CallActivityMockForSpringContext

      public CallActivityMockForSpringContext(String processId, CallActivityMock.MockedModelConfigurer modelConfigurer, org.springframework.context.ApplicationContext applicationContext)
      Variant with an ApplicationContext as the parameter. This is usually easier to get access to in the tests (e.g. via autowiring).
    • CallActivityMockForSpringContext

      public CallActivityMockForSpringContext(String processId, org.springframework.beans.factory.config.SingletonBeanRegistry springBeanRegistry)
      Constructor that does not allow for customizing of the mocked subprocess model
    • CallActivityMockForSpringContext

      public CallActivityMockForSpringContext(String processId, org.springframework.context.ApplicationContext applicationContext)
      Variant with an ApplicationContext as the parameter. This is usually easier to get access to in the tests (e.g. via autowiring).
  • Method Details

    • getSpringBeanRegistry

      public org.springframework.beans.factory.config.SingletonBeanRegistry getSpringBeanRegistry()
    • registerJavaDelegateMock

      protected void registerJavaDelegateMock(String delegateReferenceName, org.camunda.bpm.engine.delegate.JavaDelegate delegate)
      Description copied from class: CallActivityMock
      Registers a delegate under the specified name within the appropriate context. The implementation in this class uses the thread local mock registry, but subclasses might use e.g. a Spring context.
      Overrides:
      registerJavaDelegateMock in class CallActivityMock
      Parameters:
      delegateReferenceName - Name under which the delegate should be registered. After the registration, the delegate can be referenced in process models as '${name}'.
      delegate - The delegate instance to register