Class CallActivityMock
java.lang.Object
org.camunda.community.mockito.process.CallActivityMock
- All Implemented Interfaces:
DeployProcess.BpmnModelInstanceResource
- Direct Known Subclasses:
CallActivityMockForSpringContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface used as a callback to set some attributes of the mocked process model (e.g. -
Constructor Summary
ConstructorsConstructorDescriptionCallActivityMock(String processId) CallActivityMock(String processId, CallActivityMock.MockedModelConfigurer modelConfigurer) -
Method Summary
Modifier and TypeMethodDescriptionorg.camunda.bpm.engine.repository.Deploymentdeploy(org.camunda.bpm.engine.ProcessEngineServices processEngineServices) org.camunda.bpm.engine.repository.Deploymentdeploy(org.camunda.bpm.engine.RepositoryService repositoryService) This will deploy the mock process.org.camunda.bpm.model.bpmn.BpmnModelInstanceonExecutionAddVariable(String key, Object val) On execution, the MockProcess will add the given process variableonExecutionAddVariables(org.camunda.bpm.engine.variable.VariableMap variables) On execution, the MockProcess will add the given VariableMap to the executiononExecutionDo(String serviceId, Consumer<org.camunda.bpm.engine.delegate.DelegateExecution> consumer) On execution, the MockProcess will execute the given consumer with a DelegateExecution.onExecutionDo(Consumer<org.camunda.bpm.engine.delegate.DelegateExecution> consumer) On execution, the MockProcess will call the given consumer with a DelegateExecution.onExecutionRunIntoError(Throwable exception) On execution, the MockProcess will throw a RuntimeException for the given Throwable.onExecutionSendMessage(String message) On execution, the MockProcess will send the given message to allonExecutionSendMessage(String message, String businessId) On execution, the MockProcess will send the given message to a process instance with the given businessIdonExecutionSetVariables(org.camunda.bpm.engine.variable.VariableMap variables) On execution, the MockProcess will set the given VariableMap to the execution (ATTENTION: This means all current process variables are replaced with the given Map!)onExecutionThrowError(String errorCode) On execution, the MockProcess will throw error for the given code when no escalation is set If called multiple times, this method adds only the last error to the end event.onExecutionThrowEscalation(String escalationCode) On execution, the MockProcess will throw escalation for the given code If called multiple times, this method adds only the last escalation to the end event.onExecutionWaitForMessage(String message) On execution, the MockProcess will wait for the given messageonExecutionWaitForSignal(String signalName) On execution, the MockProcess will wait for the given signalonExecutionWaitForTimerWithDate(String iso8601date) On execution, the MockProcess will wait on a timer which is configured with an ISO 8601 date.On execution, the MockProcess will wait on a timer which is configured with an dateonExecutionWaitForTimerWithDuration(String iso8601duration) On execution, the MockProcess will wait on a timer which is configured with an ISO 8601 duration.protected 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 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
-
CallActivityMock
-
CallActivityMock
-
-
Method Details
-
registerJavaDelegateMock
protected void registerJavaDelegateMock(String delegateReferenceName, org.camunda.bpm.engine.delegate.JavaDelegate delegate) 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.- 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
-
onExecutionSetVariables
public CallActivityMock onExecutionSetVariables(org.camunda.bpm.engine.variable.VariableMap variables) On execution, the MockProcess will set the given VariableMap to the execution (ATTENTION: This means all current process variables are replaced with the given Map!)- Parameters:
variables- variables to set- Returns:
- this mock instance
-
onExecutionAddVariables
public CallActivityMock onExecutionAddVariables(org.camunda.bpm.engine.variable.VariableMap variables) On execution, the MockProcess will add the given VariableMap to the execution- Parameters:
variables- the variables to add- Returns:
- self
-
onExecutionAddVariable
On execution, the MockProcess will add the given process variable- Parameters:
key- ... key of the process variableval- ... value of the process variable- Returns:
- self
-
onExecutionDo
public CallActivityMock onExecutionDo(Consumer<org.camunda.bpm.engine.delegate.DelegateExecution> consumer) On execution, the MockProcess will call the given consumer with a DelegateExecution.- Parameters:
consumer- the javaDelegate code to be called on execution- Returns:
- self
-
onExecutionDo
public CallActivityMock onExecutionDo(String serviceId, Consumer<org.camunda.bpm.engine.delegate.DelegateExecution> consumer) On execution, the MockProcess will execute the given consumer with a DelegateExecution.- Parameters:
serviceId- ... the id of the mock delegateconsumer- delegate for service task- Returns:
- self
-
onExecutionWaitForTimerWithDate
On execution, the MockProcess will wait on a timer which is configured with an date- Parameters:
date- the timer dueDate- Returns:
- self
-
onExecutionWaitForTimerWithDate
On execution, the MockProcess will wait on a timer which is configured with an ISO 8601 date. E.g.: 2018-10-14T14:10:00Z- Parameters:
iso8601date- the timer dueDate- Returns:
- self
-
onExecutionWaitForTimerWithDuration
On execution, the MockProcess will wait on a timer which is configured with an ISO 8601 duration. E.g.: PT60S ... will wait for 60 sec- Parameters:
iso8601duration- the timer dueDate- Returns:
- self
-
onExecutionSendMessage
On execution, the MockProcess will send the given message to all- Parameters:
message- the message to receive- Returns:
- self
-
onExecutionSendMessage
On execution, the MockProcess will send the given message to a process instance with the given businessId- Parameters:
message- the message to receivebusinessId- the process business key- Returns:
- self
-
onExecutionWaitForMessage
On execution, the MockProcess will wait for the given message- Parameters:
message- the message to receive- Returns:
- self
-
onExecutionRunIntoError
On execution, the MockProcess will throw a RuntimeException for the given Throwable.- Parameters:
exception- the error to throw- Returns:
- self
-
onExecutionWaitForSignal
On execution, the MockProcess will wait for the given signal- Parameters:
signalName- the signal to receive- Returns:
- self
-
onExecutionThrowEscalation
On execution, the MockProcess will throw escalation for the given code If called multiple times, this method adds only the last escalation to the end event.- Parameters:
escalationCode- the escalation code- Returns:
- self
-
onExecutionThrowError
On execution, the MockProcess will throw error for the given code when no escalation is set If called multiple times, this method adds only the last error to the end event.- Parameters:
errorCode- the errorCode- Returns:
- self
-
deploy
public org.camunda.bpm.engine.repository.Deployment deploy(org.camunda.bpm.engine.RepositoryService repositoryService) This will deploy the mock process. -
deploy
public org.camunda.bpm.engine.repository.Deployment deploy(org.camunda.bpm.engine.ProcessEngineServices processEngineServices) -
getResourceName
- Specified by:
getResourceNamein interfaceDeployProcess.BpmnModelInstanceResource
-
getModelInstance
public org.camunda.bpm.model.bpmn.BpmnModelInstance getModelInstance()- Specified by:
getModelInstancein interfaceDeployProcess.BpmnModelInstanceResource
-