public class TestCaseExecutor extends Object
| Constructor and Description |
|---|
TestCaseExecutor(TestCaseInstance instance,
Consumer<org.camunda.bpm.engine.runtime.ProcessInstance> executor) |
| Modifier and Type | Method and Description |
|---|---|
TestCaseExecutor |
customize(Consumer<TestCaseExecutor> customizer)
Customizes the executor, using the given
Consumer function. |
org.camunda.bpm.engine.runtime.ProcessInstance |
execute()
Create a new
ProcessInstance, executes the actual test case and verifies the state after. |
void |
execute(org.camunda.bpm.engine.runtime.ProcessInstance pi)
Executes the actual test case and verifies the state after, using the given
ProcessInstance. |
org.camunda.bpm.engine.runtime.ProcessInstance |
execute(String processInstanceId)
Executes the actual test case and verifies the state after, using the
ProcessInstance,
identified by the given ID. |
protected org.camunda.bpm.engine.ProcessEngineException |
unwrapAssertionError(org.camunda.bpm.engine.ProcessEngineException e)
Unwraps and throws a possible
AssertionError in case of a failed assertion within a
CallActivityHandler's verifier. |
TestCaseExecutor |
verify(Consumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert> verifier)
Verifies that state after the test case execution has finished.
|
TestCaseExecutor |
withBean(String key,
Object value)
Registers a bean for the given key.
Please note: If Spring is enabled, the beans will be provided via Spring's application context (e.g. |
TestCaseExecutor |
withBusinessKey(String businessKey)
Sets the business key of the process instance that will be created.
|
TestCaseExecutor |
withVariable(String name,
Object value)
Sets a variable on the process instance that will be created.
|
TestCaseExecutor |
withVariableTyped(String name,
org.camunda.bpm.engine.variable.value.TypedValue value)
Sets a typed variable on the process instance that will be started.
|
public TestCaseExecutor(TestCaseInstance instance, Consumer<org.camunda.bpm.engine.runtime.ProcessInstance> executor)
public TestCaseExecutor customize(Consumer<TestCaseExecutor> customizer)
Consumer function. This method can be used to
apply a common customization needed for different test cases.
tc.createExecutor().customize(this::prepareVariables).execute();
customizer - A function that accepts a TestCaseExecutor.public org.camunda.bpm.engine.runtime.ProcessInstance execute()
ProcessInstance, executes the actual test case and verifies the state after.public void execute(org.camunda.bpm.engine.runtime.ProcessInstance pi)
ProcessInstance.pi - A process instance, used to execute the test case.public org.camunda.bpm.engine.runtime.ProcessInstance execute(String processInstanceId)
ProcessInstance,
identified by the given ID.processInstanceId - The ID of an existing process instance.protected org.camunda.bpm.engine.ProcessEngineException unwrapAssertionError(org.camunda.bpm.engine.ProcessEngineException e)
AssertionError in case of a failed assertion within a
CallActivityHandler's verifier. If not unwrapped, a test will be marked as an error,
instead of a failure!e - An exception that has been catched during process instance execution.null or not an
assertion error.public TestCaseExecutor verify(Consumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert> verifier)
verifier - Verifier that accepts an ProcessInstanceAssert instance.public TestCaseExecutor withBean(String key, Object value)
key - The key, under which the bean is registered.value - The value.Mocks.register(String, Object)public TestCaseExecutor withBusinessKey(String businessKey)
businessKey - A specific business key.public TestCaseExecutor withVariable(String name, Object value)
name - The name of the variable.value - The variable's value.public TestCaseExecutor withVariableTyped(String name, org.camunda.bpm.engine.variable.value.TypedValue value)
name - The name of the variable.value - The variable's typed value.Copyright © 2022 Camunda Services GmbH. All rights reserved.