Package org.camunda.community.bpmndt.api
Class OutboundConnectorHandler
java.lang.Object
org.camunda.community.bpmndt.api.OutboundConnectorHandler
Fluent API to handle outbound connectors. Please note: an outbound connector is completed by default.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Executes an action that completes the underlying job, when the process instance is waiting at the corresponding element, using specified variables.customize(Consumer<OutboundConnectorHandler> customizer) Customizes the handler, using the givenConsumerfunction.voidexecute(BiConsumer<io.camunda.zeebe.client.ZeebeClient, Long> action) Executes a custom action that handles the underlying job, when the process instance is waiting at the corresponding element.voidthrowBpmnError(String errorCode, String errorMessage) Throws an BPMN error using the given error code and message as well as the specified variables.Verifies the outbound connector's waiting state.verifyInputMapping(Consumer<Map<String, String>> inputMappingConsumer) Verifies the modeled inputs of the connector's IO mapping, using a consumer function.verifyOutputMapping(Consumer<Map<String, String>> outputMappingConsumer) Verifies the modeled outputs of the connector's IO mapping, using a consumer function.verifyRetries(Integer expectedRetries) Verifies that the underlying job has a specific number of retries.verifyRetries(Consumer<Integer> retriesConsumer) Verifies that the underlying job has a specific number of retries, using a consumer.verifyTaskDefinitionType(String expectedTaskDefinitionType) Verifies that the outbound connector has the given task definition type.verifyTaskDefinitionType(Consumer<String> taskDefinitionTypeConsumer) Verifies that the outbound connector has a specific task definition type, using a consumer.verifyTaskHeaders(Consumer<Map<String, String>> taskHeadersConsumer) Verifies the modeled task headers of the connector, using a consumer function.withVariable(String name, Object value) Sets a variable that is used to complete the underlying job.withVariableMap(Map<String, Object> variableMap) Sets variables that are used to complete the underlying job.withVariables(Object variables) Sets an object as variables that is used to complete the underlying job.
-
Constructor Details
-
OutboundConnectorHandler
-
OutboundConnectorHandler
-
-
Method Details
-
complete
public void complete()Executes an action that completes the underlying job, when the process instance is waiting at the corresponding element, using specified variables.- See Also:
-
customize
Customizes the handler, using the givenConsumerfunction. This method can be used to apply a common customization needed for different test cases.tc.handleOutboundConnector().customize(this::prepare);
- Parameters:
customizer- A function that accepts aOutboundConnectorHandler.- Returns:
- The handler.
-
execute
Executes a custom action that handles the underlying job, when the process instance is waiting at the corresponding element.- Parameters:
action- A specific action that accepts aZeebeClientand the related job key.- See Also:
-
throwBpmnError
Throws an BPMN error using the given error code and message as well as the specified variables.- See Also:
-
verify
public OutboundConnectorHandler verify(Consumer<io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert> verifier) Verifies the outbound connector's waiting state. This method can be used to assert the variables, created by the connector's input mapping.- Parameters:
verifier- Verifier that accepts anProcessInstanceAssertinstance.- Returns:
- The handler.
-
verifyInputMapping
public OutboundConnectorHandler verifyInputMapping(Consumer<Map<String, String>> inputMappingConsumer) Verifies the modeled inputs of the connector's IO mapping, using a consumer function.- Parameters:
inputMappingConsumer- A consumer asserting the input mapping.- Returns:
- The handler.
-
verifyOutputMapping
public OutboundConnectorHandler verifyOutputMapping(Consumer<Map<String, String>> outputMappingConsumer) Verifies the modeled outputs of the connector's IO mapping, using a consumer function.- Parameters:
outputMappingConsumer- A consumer asserting the output mapping.- Returns:
- The handler.
-
verifyRetries
Verifies that the underlying job has a specific number of retries.- Parameters:
expectedRetries- The expected retry count.- Returns:
- The handler.
-
verifyRetries
Verifies that the underlying job has a specific number of retries, using a consumer.- Parameters:
retriesConsumer- A consumer asserting the retry count.- Returns:
- The handler.
-
verifyTaskDefinitionType
Verifies that the outbound connector has the given task definition type.- Parameters:
expectedTaskDefinitionType- The expected task definition type.- Returns:
- The handler.
-
verifyTaskDefinitionType
public OutboundConnectorHandler verifyTaskDefinitionType(Consumer<String> taskDefinitionTypeConsumer) Verifies that the outbound connector has a specific task definition type, using a consumer.- Parameters:
taskDefinitionTypeConsumer- A consumer asserting the task definition type.- Returns:
- The handler.
-
verifyTaskHeaders
Verifies the modeled task headers of the connector, using a consumer function.- Parameters:
taskHeadersConsumer- A consumer asserting the task headers.- Returns:
- The handler.
-
withVariable
Sets a variable that is used to complete the underlying job.- Parameters:
name- The name of the variable.value- The variable's value.- Returns:
- The handler.
- See Also:
-
withVariables
Sets an object as variables that is used to complete the underlying job.- Parameters:
variables- The variables as POJO.- Returns:
- The handler.
- See Also:
-
withVariableMap
Sets variables that are used to complete the underlying job.- Parameters:
variableMap- A map of variables.- Returns:
- The handler.
- See Also:
-