Package org.camunda.community.bpmndt.api
Class TestCaseInstance
java.lang.Object
org.camunda.community.bpmndt.api.TestCaseInstance
- All Implemented Interfaces:
AutoCloseable
Link between a test case and its execution.
This class is utilizing a process instance that was instantiated by a TestCaseExecutor and handlers (e.g. UserTaskHandler) that are part of a
test case.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply(long flowScopeKey, CallActivityHandler handler) voidapply(long flowScopeKey, CustomMultiInstanceHandler handler) voidapply(long flowScopeKey, JobHandler handler) voidapply(long flowScopeKey, MessageEventHandler handler) voidapply(long flowScopeKey, OutboundConnectorHandler handler) voidapply(long flowScopeKey, ReceiveTaskHandler handler) voidapply(long flowScopeKey, SignalEventHandler handler) voidapply(long flowScopeKey, TimerEventHandler handler) voidapply(long flowScopeKey, UserTaskHandler handler) voidclose()createException(String message, long flowScopeKey) io.camunda.zeebe.client.ZeebeClientlonggetElementInstanceKey(long flowScopeKey, String elementId) Returns the element instance key for a BPMN element within a given flow scope.io.camunda.zeebe.process.test.api.ZeebeTestEnginelonggetFlowScopeKey(long elementInstanceKey) Returns the flow scope key of an element instance.longgetProcessInstanceKey(long elementInstanceKey) Returns the process instance key of an element instance.voidChecks if a BPMN element has been passed within the given flow scope.voidhasPassedMultiInstance(long flowScopeKey, String elementId) Checks if a BPMN multi instance element has been passed within the given flow scope.voidhasTerminated(long flowScopeKey, String elementId) Checks if a BPMN element has been terminated within the given flow scope.voidhasTerminatedMultiInstance(long flowScopeKey, String elementId) Checks if a BPMN multi instance element has been terminated within the given flow scope.voidisActivating(long flowScopeKey, String elementId) Checks if a BPMN element is being activated within the given flow scope.voidisCompleted(long processInstanceKey) Checks if the given process instance is completed.voidisWaitingAt(long flowScopeKey, String elementId) Checks if a flow is waiting at a specific BPMN element.
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
apply
-
apply
-
apply
-
apply
-
apply
-
apply
-
apply
-
apply
-
apply
-
createException
-
getClient
public io.camunda.zeebe.client.ZeebeClient getClient() -
getEngine
public io.camunda.zeebe.process.test.api.ZeebeTestEngine getEngine() -
getElementInstanceKey
Returns the element instance key for a BPMN element within a given flow scope.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID.- Returns:
- The element instance key.
- Throws:
RuntimeException- If no such element instance exists.
-
getFlowScopeKey
public long getFlowScopeKey(long elementInstanceKey) Returns the flow scope key of an element instance.- Parameters:
elementInstanceKey- The key of an existing element instance.- Returns:
- The flow scope key or
-1if there is no mapping for the given element instance.
-
getProcessInstanceKey
public long getProcessInstanceKey(long elementInstanceKey) Returns the process instance key of an element instance.- Parameters:
elementInstanceKey- The key of an existing element instance.- Returns:
- The process instance key.
-
hasPassed
Checks if a BPMN element has been passed within the given flow scope.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID to test.- Throws:
RuntimeException- If the BPMN element has not been passed (is not completed).
-
hasPassedMultiInstance
Checks if a BPMN multi instance element has been passed within the given flow scope.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID to test.- Throws:
RuntimeException- If the BPMN multi instance element has not been passed (is not completed).
-
hasTerminated
Checks if a BPMN element has been terminated within the given flow scope.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID to test.- Throws:
RuntimeException- If the BPMN element has not been terminated.
-
hasTerminatedMultiInstance
Checks if a BPMN multi instance element has been terminated within the given flow scope.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID to test.- Throws:
RuntimeException- If the BPMN multi instance element has not been terminated.
-
isActivating
Checks if a BPMN element is being activated within the given flow scope. This method is used to verify that a terminating end event (error or escalation) has been reached.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element ID to test.- Throws:
RuntimeException- If the BPMN element is not being activated.
-
isCompleted
public void isCompleted(long processInstanceKey) Checks if the given process instance is completed.- Parameters:
processInstanceKey- The key of an existing process instance.- Throws:
RuntimeException- If the process instance is not completed.
-
isWaitingAt
Checks if a flow is waiting at a specific BPMN element.- Parameters:
flowScopeKey- The key of an existing flow scope.elementId- The BPMN element to test.- Throws:
RuntimeException- If the flow is not waiting at the BPMN element.
-