Package org.camunda.community.bpmndt.api
Class AbstractTestCase
java.lang.Object
org.camunda.community.bpmndt.api.AbstractTestCase
- Direct Known Subclasses:
AbstractJUnit5TestCase
Abstract superclass for test cases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the setup for a test case execution by initializing all element handlers.createExecutor(io.camunda.zeebe.process.test.api.ZeebeTestEngine engine) Creates a new executor, used to specify variables that are considered during test case execution.protected abstract voidexecute(TestCaseInstance instance, long processInstanceKey) Executes the test case.abstract StringReturns the ID of the BPMN process that is tested.protected InputStreamReturns an input stream that provides the BPMN resource with the process definition to be tested - either this method orgetBpmnResourceName()must be overridden!protected StringReturns the name of the BPMN resource, that provides the process definition to be tested - either this method orgetBpmnResource()must be overridden!abstract StringgetEnd()Returns the ID of the test case's end activity.protected StringReturns the BPMN resource used to simulate arbitrary sub processes.abstract StringgetStart()Returns the ID of the test case's start element.protected booleanDetermines if the test case's start element is a message start event or not.protected booleanDetermines if the test case's start element starts the process or not.protected booleanDetermines if the test case's start element is a signal start event or not.protected booleanDetermines if the test case's start element is a timer start event or not.
-
Constructor Details
-
AbstractTestCase
public AbstractTestCase()
-
-
Method Details
-
beforeEach
protected void beforeEach()Performs the setup for a test case execution by initializing all element handlers. This method must be invoked before each test! -
createExecutor
Creates a new executor, used to specify variables that are considered during test case execution. After the specification,TestCaseExecutor.execute()is called to create a new process instance and execute the test case.- Parameters:
engine- The Zeebe test engine to use.- Returns:
- The newly created executor.
-
execute
Executes the test case.- Parameters:
instance- The test case instance to use.processInstanceKey- The key of the related process instance, created during the start of the test case.
-
getBpmnProcessId
Returns the ID of the BPMN process that is tested.- Returns:
- The BPMN process ID.
-
getBpmnResource
Returns an input stream that provides the BPMN resource with the process definition to be tested - either this method orgetBpmnResourceName()must be overridden!- Returns:
- The BPMN resource as stream.
-
getBpmnResourceName
Returns the name of the BPMN resource, that provides the process definition to be tested - either this method orgetBpmnResource()must be overridden!- Returns:
- The BPMN resource name, within
src/main/resources.
-
getEnd
Returns the ID of the test case's end activity.- Returns:
- The end activity ID.
-
getSimulateSubProcessResource
Returns the BPMN resource used to simulate arbitrary sub processes. This method must be overridden, since the default implementation relies on a classpath resource, which is not available when a concrete test case is executed.- Returns:
- The simulate sub process BPMN as string.
-
getStart
Returns the ID of the test case's start element.- Returns:
- The start activity ID.
-
isMessageStart
protected boolean isMessageStart()Determines if the test case's start element is a message start event or not. This method returnsfalse, if not overridden.- Returns:
true, if the test case's start element is a message start event. Otherwisefalse.
-
isProcessStart
protected boolean isProcessStart()Determines if the test case's start element starts the process or not. This is the case if the BPMN element is a start event and if the element's parent scope is the process. This method returnstrue, if not overridden.- Returns:
true, if the test case's start element starts the process. Otherwisefalse.
-
isSignalStart
protected boolean isSignalStart()Determines if the test case's start element is a signal start event or not. This method returnsfalse, if not overridden.- Returns:
true, if the test case's start element is a signal start event. Otherwisefalse.
-
isTimerStart
protected boolean isTimerStart()Determines if the test case's start element is a timer start event or not. This method returnsfalse, if not overridden.- Returns:
true, if the test case's start element is a timer start event. Otherwisefalse.
-