Class OutboundConnectorHandler

java.lang.Object
org.camunda.community.bpmndt.api.OutboundConnectorHandler

public class OutboundConnectorHandler extends Object
Fluent API to handle outbound connectors. Please note: an outbound connector is completed by default.
  • Constructor Details

  • 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 given Consumer function. 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 a OutboundConnectorHandler.
      Returns:
      The handler.
    • execute

      public void execute(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.
      Parameters:
      action - A specific action that accepts a ZeebeClient and the related job key.
      See Also:
      • JobClient.newCompleteCommand(long)
    • throwBpmnError

      public void throwBpmnError(String errorCode, String errorMessage)
      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 an ProcessInstanceAssert instance.
      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

      public OutboundConnectorHandler verifyRetries(Integer expectedRetries)
      Verifies that the underlying job has a specific number of retries.
      Parameters:
      expectedRetries - The expected retry count.
      Returns:
      The handler.
    • verifyRetries

      public OutboundConnectorHandler verifyRetries(Consumer<Integer> retriesConsumer)
      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

      public OutboundConnectorHandler verifyTaskDefinitionType(String expectedTaskDefinitionType)
      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

      public OutboundConnectorHandler verifyTaskHeaders(Consumer<Map<String,String>> taskHeadersConsumer)
      Verifies the modeled task headers of the connector, using a consumer function.
      Parameters:
      taskHeadersConsumer - A consumer asserting the task headers.
      Returns:
      The handler.
    • withVariable

      public OutboundConnectorHandler withVariable(String name, Object value)
      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

      public OutboundConnectorHandler withVariables(Object variables)
      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

      public OutboundConnectorHandler withVariableMap(Map<String,Object> variableMap)
      Sets variables that are used to complete the underlying job.
      Parameters:
      variableMap - A map of variables.
      Returns:
      The handler.
      See Also: