T - The generated test case type.public abstract class AbstractTestCase<T extends AbstractTestCase<?>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected TestCaseInstance |
instance |
protected Class<?> |
testClass
The related test class - must be provided by the concrete implementation.
|
protected String |
testMethodName
The test method, which will be executed - must be provided by the concrete implementation.
|
| Constructor and Description |
|---|
AbstractTestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterEach()
Performs the teardown for an test case execution.
|
protected void |
beforeEach()
Performs the setup for an test case execution by creating a
TestCaseInstance and
deploying the related BPMN resources. |
protected org.camunda.bpm.engine.ProcessEngine |
buildProcessEngine()
Builds the process engine, used to execute the test case.
|
TestCaseExecutor |
createExecutor()
Creates a new executor, used to specify variables, business key and/or mocks that are considered
during test case execution.
|
protected abstract void |
execute(org.camunda.bpm.engine.runtime.ProcessInstance pi)
Executes the test case.
|
protected InputStream |
getBpmnResource()
Returns an input stream that provides the BPMN resource with the process definition to be tested
- either this method or
getBpmnResourceName() must be overridden! |
protected String |
getBpmnResourceName()
Returns the name of the BPMN resource, that provides the process definition to be tested - either
this method or
getBpmnResource() must be overridden! |
String |
getDeploymentId()
Returns the ID of the process definition deployment.
|
abstract String |
getEnd()
Returns the ID of the test case's end activity.
|
abstract String |
getProcessDefinitionKey()
Returns the key of the process definition that is tested.
|
org.camunda.bpm.engine.ProcessEngine |
getProcessEngine()
Returns the process engine, used to execute the test case.
|
protected List<org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin> |
getProcessEnginePlugins()
Provides custom
ProcessEnginePlugins to be registered when the process engine is built. |
abstract String |
getStart()
Returns the ID of the test case's start activity.
|
protected boolean |
isProcessEnd()
Determines if the test case's end activity ends the process or not.
|
protected boolean |
isSpringEnabled()
Determines if Spring based testing is enabled or not.
|
T |
withTenantId(String tenantId)
Sets the tenant ID to be used for the automatic process definition deployment.
|
protected Class<?> testClass
protected String testMethodName
protected TestCaseInstance instance
protected void beforeEach()
TestCaseInstance and
deploying the related BPMN resources. This method must be invoked before each test!protected void afterEach()
protected org.camunda.bpm.engine.ProcessEngine buildProcessEngine()
ProcessEnginePlugins as well as the BpmndtProcessEnginePlugin, which is required
to configure a conform process engine.public TestCaseExecutor createExecutor()
TestCaseExecutor.execute() is called
to create a new ProcessInstance and execute the test case.protected abstract void execute(org.camunda.bpm.engine.runtime.ProcessInstance pi)
pi - A process instance, created especially for the test case.protected InputStream getBpmnResource()
getBpmnResourceName() must be overridden!protected String getBpmnResourceName()
getBpmnResource() must be overridden!src/main/resources.public String getDeploymentId()
public abstract String getEnd()
public abstract String getProcessDefinitionKey()
public org.camunda.bpm.engine.ProcessEngine getProcessEngine()
protected List<org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin> getProcessEnginePlugins()
ProcessEnginePlugins to be registered when the process engine is built.
By default, this method return an empty list. It can be overridden by any extending class.buildProcessEngine()public abstract String getStart()
protected boolean isSpringEnabled()
false, if not
overridden.true, if the testing is Spring based. Otherwise false.protected boolean isProcessEnd()
true, if not overridden.true, if the test case's end activity ends the process. Otherwise false.Copyright © 2023 Camunda Services GmbH. All rights reserved.