Class ProcessInstanceAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<ProcessInstanceAssert,Long>
io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<ProcessInstanceAssert,Long>, org.assertj.core.api.Descriptable<ProcessInstanceAssert>, org.assertj.core.api.ExtensionPoints<ProcessInstanceAssert,Long>

public class ProcessInstanceAssert extends org.assertj.core.api.AbstractAssert<ProcessInstanceAssert,Long>
Assertions for process instances. A process instance is identified by its process instance key.
  • Constructor Details

    • ProcessInstanceAssert

      public ProcessInstanceAssert(long actual, RecordStream recordStream)
  • Method Details

    • isStarted

      public ProcessInstanceAssert isStarted()
      Verifies the expectation that the process instance is started. This will also be true when the process has been completed or terminated.
      Returns:
      this ProcessInstanceAssert
    • isActive

      public ProcessInstanceAssert isActive()
      Verifies the expectation that the process instance is active.
      Returns:
      this ProcessInstanceAssert
    • isCompleted

      public ProcessInstanceAssert isCompleted()
      Verifies the expectation that the process instance is completed.
      Returns:
      this ProcessInstanceAssert
    • isNotCompleted

      public ProcessInstanceAssert isNotCompleted()
      Verifies the expectation that the process instance is not completed.
      Returns:
      this ProcessInstanceAssert
    • isTerminated

      public ProcessInstanceAssert isTerminated()
      Verifies the expectation that the process instance is terminated.
      Returns:
      this ProcessInstanceAssert
    • isNotTerminated

      public ProcessInstanceAssert isNotTerminated()
      Verifies the expectation that the process instance is not terminated.
      Returns:
      this ProcessInstanceAssert
    • hasPassedElement

      public ProcessInstanceAssert hasPassedElement(String elementId)
      Verifies the expectation that the process instance has passed an element with a specific element id exactly one time.
      Parameters:
      elementId - The id of the element
      Returns:
      this ProcessInstanceAssert
    • hasNotPassedElement

      public ProcessInstanceAssert hasNotPassedElement(String elementId)
      Verifies the expectation that the process instance has not passed an element with a specific element id.
      Parameters:
      elementId - The id of the element
      Returns:
      this ProcessInstanceAssert
    • hasPassedElement

      public ProcessInstanceAssert hasPassedElement(String elementId, int times)
      Verifies the expectation that the process instance has passed an element with a specific element id exactly N amount of times.
      Parameters:
      elementId - The id of the element
      times - The amount of times the element should be passed
      Returns:
      this ProcessInstanceAssert
    • hasPassedElementsInOrder

      public ProcessInstanceAssert hasPassedElementsInOrder(String... elementIds)
      Verifies the expectation that the process instance has passed the given elements in order.
      Parameters:
      elementIds - The element ids
      Returns:
      this ProcessInstanceAssert
    • isWaitingAtElements

      public ProcessInstanceAssert isWaitingAtElements(String... elementIds)
      Verifies the expectation that the process instance is currently waiting at one or more specified elements.
      Parameters:
      elementIds - The ids of the elements
      Returns:
      this ProcessInstanceAssert
    • isNotWaitingAtElements

      public ProcessInstanceAssert isNotWaitingAtElements(String... elementIds)
      Verifies the expectation that the process instance is currently not waiting at one or more specified elements.
      Parameters:
      elementIds - The ids of the elements
      Returns:
      this ProcessInstanceAssert
    • isWaitingExactlyAtElements

      public ProcessInstanceAssert isWaitingExactlyAtElements(String... elementIdsVarArg)
      Verifies the expectation that the process instance is currently waiting at the specified elements, and not at any other element.
      Parameters:
      elementIdsVarArg - The ids of the elements
      Returns:
      this ProcessInstanceAssert
    • isWaitingForMessages

      public ProcessInstanceAssert isWaitingForMessages(String... messageNames)
      Verifies the expectation that the process instance is currently waiting to receive one or more specified messages.
      Parameters:
      messageNames - Names of the messages
      Returns:
      this ProcessInstanceAssert
    • isNotWaitingForMessages

      public ProcessInstanceAssert isNotWaitingForMessages(String... messageNames)
      Verifies the expectation that the process instance is currently not waiting to receive one or more specified messages.
      Parameters:
      messageNames - Names of the messages
      Returns:
      this ProcessInstanceAssert
    • hasCorrelatedMessageByName

      public ProcessInstanceAssert hasCorrelatedMessageByName(String messageName, int times)
      Verifies the expectation that a message with a given name has been correlated a given amount of times.
      Parameters:
      messageName - The name of the message
      times - The expected amount of times the message is correlated
      Returns:
      this ProcessInstanceAssert
    • hasCorrelatedMessageByCorrelationKey

      public ProcessInstanceAssert hasCorrelatedMessageByCorrelationKey(String correlationKey, int times)
      Verifies the expectation that a message with a given correlation key has been correlated a given amount of times.
      Parameters:
      correlationKey - The correlation key of the message
      times - The expected amount of times the message is correlated
      Returns:
      this ProcessInstanceAssert
    • hasVariable

      public ProcessInstanceAssert hasVariable(String name)
      Parameters:
      name - The name of the variable
      Returns:
      this $ProcessInstanceAssert
    • hasVariableWithValue

      public ProcessInstanceAssert hasVariableWithValue(String name, Object value)
      Verifies the process instance has a variable with a specific value.
      Parameters:
      name - The name of the variable
      value - The value of the variable
      Returns:
      this $ProcessInstanceAssert
    • hasAnyIncidents

      public ProcessInstanceAssert hasAnyIncidents()
      Asserts whether any incidents were raised for this process instance (regardless of whether these incidents are active or already resolved)
      Returns:
      this ProcessInstanceAssert
    • hasNoIncidents

      public ProcessInstanceAssert hasNoIncidents()
      Asserts whether no incidents were raised for this process instance
      Returns:
      this ProcessInstanceAssert
    • extractingLatestIncident

      public IncidentAssert extractingLatestIncident()
      Extracts the latest incident
      Returns:
      IncidentAssert for the latest incident
    • extractingLatestCalledProcess

      public ProcessInstanceAssert extractingLatestCalledProcess(String processId)
      Extracts the latest called process. This will result in a failed assertion when no process has been called.
      Returns:
      ProcessInstanceAssert for the called process
    • hasCalledProcess

      public ProcessInstanceAssert hasCalledProcess(String processId)
      Asserts whether this process has called another process
      Parameters:
      processId - The id of the process that should be called
      Returns:
      this ProcessInstanceAssert