Class CallActivityMockForSpringContext
java.lang.Object
org.camunda.community.mockito.process.CallActivityMock
org.camunda.community.mockito.process.CallActivityMockForSpringContext
- All Implemented Interfaces:
DeployProcess.BpmnModelInstanceResource
Implementation that registers the delegates mocks for the mocked subprocess to the gived spring bean context.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.camunda.community.mockito.process.CallActivityMock
CallActivityMock.MockedModelConfigurer -
Constructor Summary
ConstructorsConstructorDescriptionCallActivityMockForSpringContext(String processId, CallActivityMock.MockedModelConfigurer modelConfigurer, org.springframework.beans.factory.config.SingletonBeanRegistry springBeanRegistry) CallActivityMockForSpringContext(String processId, CallActivityMock.MockedModelConfigurer modelConfigurer, org.springframework.context.ApplicationContext applicationContext) Variant with an ApplicationContext as the parameter.CallActivityMockForSpringContext(String processId, org.springframework.beans.factory.config.SingletonBeanRegistry springBeanRegistry) Constructor that does not allow for customizing of the mocked subprocess modelCallActivityMockForSpringContext(String processId, org.springframework.context.ApplicationContext applicationContext) Variant with an ApplicationContext as the parameter. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.beans.factory.config.SingletonBeanRegistryprotected voidregisterJavaDelegateMock(String delegateReferenceName, org.camunda.bpm.engine.delegate.JavaDelegate delegate) Registers a delegate under the specified name within the appropriate context.Methods inherited from class org.camunda.community.mockito.process.CallActivityMock
deploy, deploy, getModelInstance, getResourceName, onExecutionAddVariable, onExecutionAddVariables, onExecutionDo, onExecutionDo, onExecutionRunIntoError, onExecutionSendMessage, onExecutionSendMessage, onExecutionSetVariables, onExecutionThrowError, onExecutionThrowEscalation, onExecutionWaitForMessage, onExecutionWaitForSignal, onExecutionWaitForTimerWithDate, onExecutionWaitForTimerWithDate, onExecutionWaitForTimerWithDurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.camunda.community.mockito.function.DeployProcess.BpmnModelInstanceResource
addToDeployment
-
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 subprocessspringBeanRegistry- 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:CallActivityMockRegisters 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:
registerJavaDelegateMockin classCallActivityMock- 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
-