Class BpmnAssert

java.lang.Object
io.camunda.zeebe.process.test.assertions.BpmnAssert

public abstract class BpmnAssert extends Object
This class manages all the entry points for the specific assertions.

For example when starting a process instance:


 ProcessInstanceEvent event = client.newCreateInstanceCommand()
     .bpmnProcessId("processId")
     .latestVersion()
     .send()
     .join();
 ProcessInstanceAssert assertions = BpmnAssert.assertThat(event);
 
  • Constructor Details

    • BpmnAssert

      public BpmnAssert()
  • Method Details

    • initRecordStream

      public static void initRecordStream(RecordStream recordStream)
      Initializes a RecordStream. The RecordStream will be stored in a ThreadLocal and thus will only be accessible in the current thread. This will be managed for you if you're using the @ZeebeProcessTest annotation.
      Parameters:
      recordStream - the RecordStream
    • resetRecordStream

      public static void resetRecordStream()
      Removes the RecordStream from the ThreadLocal.
    • getRecordStream

      public static RecordStream getRecordStream()
      Gets the RecordStream that is stored in the ThreadLocal for the current thread. This will be managed for you if you're using the @ZeebeProcessTest annotation.
      Returns:
      the RecordStream stored for this thread
      Throws:
      AssertionError - if no RecordStream has been initialized for the current thread
    • assertThat

      public static ProcessInstanceAssert assertThat(io.camunda.client.api.response.ProcessInstanceEvent instanceEvent)
      Creates a new instance of ProcessInstanceAssert.
      Parameters:
      instanceEvent - the event received when starting a process instance
      Returns:
      the created assertion object
    • assertThat

      public static ProcessInstanceAssert assertThat(io.camunda.client.api.response.ProcessInstanceResult instanceResult)
      Creates a new instance of ProcessInstanceAssert.
      Parameters:
      instanceResult - the event received when starting a process instance
      Returns:
      the created assertion object
    • assertThat

      public static ProcessInstanceAssert assertThat(InspectedProcessInstance inspectedProcessInstance)
      Creates a new instance of ProcessInstanceAssert.
      Parameters:
      inspectedProcessInstance - the InspectedProcessInstance received from the ProcessInstanceInspections
      Returns:
      the created assertion object
    • assertThat

      public static JobAssert assertThat(io.camunda.client.api.response.ActivatedJob activatedJob)
      Creates a new instance of JobAssert.
      Parameters:
      activatedJob - the response received when activating a job
      Returns:
      the created assertion object
    • assertThat

      public static DeploymentAssert assertThat(io.camunda.client.api.response.DeploymentEvent deploymentEvent)
      Creates a new instance of DeploymentAssert.
      Parameters:
      deploymentEvent - the event received when deploying a process
      Returns:
      the created assertion object
    • assertThat

      public static MessageAssert assertThat(io.camunda.client.api.response.PublishMessageResponse publishMessageResponse)
      Creates a new instance of PublishMessageResponse.
      Parameters:
      publishMessageResponse - the response received when publishing a message
      Returns:
      the created assertion object