Class ProcessInstanceAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<S,A>
org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<ProcessInstanceAssert,ProcessInstance>, org.assertj.core.api.Descriptable<ProcessInstanceAssert>, org.assertj.core.api.ExtensionPoints<ProcessInstanceAssert,ProcessInstance>
Direct Known Subclasses:
CalledProcessInstanceAssert

public class ProcessInstanceAssert extends AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
Assertions for a ProcessInstance.
  • Field Details

  • Constructor Details

  • Method Details

    • assertThat

      protected static ProcessInstanceAssert assertThat(ProcessEngine engine, ProcessInstance actual)
    • getCurrent

      protected ProcessInstance getCurrent()
      Specified by:
      getCurrent in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • toString

      protected String toString(ProcessInstance processInstance)
      Specified by:
      toString in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • isWaitingAt

      public ProcessInstanceAssert isWaitingAt(String... activityIds)
      Verifies the expectation that the ProcessInstance is currently waiting at one or more specified activities.
      Parameters:
      activityIds - the id's of the activities the process instance is Expecting to be waiting at
      Returns:
      this ProcessInstanceAssert
    • isNotWaitingAt

      public ProcessInstanceAssert isNotWaitingAt(String... activityIds)
      Verifies the expectation that the ProcessInstance is currently NOT waiting at one or more specified activities.
      Parameters:
      activityIds - the id's of the activities the process instance is expected not to be waiting at
      Returns:
      this ProcessInstanceAssert
    • isWaitingAtExactly

      public ProcessInstanceAssert isWaitingAtExactly(String... activityIds)
      Verifies the expectation that the ProcessInstance is currently waiting at exactly one or more specified activities.
      Parameters:
      activityIds - the id's of the activities the process instance is Expecting to be waiting at
      Returns:
      this ProcessInstanceAssert
    • isWaitingFor

      public ProcessInstanceAssert isWaitingFor(String... messageNames)
      Verifies the expectation that the ProcessInstance is currently waiting for one or more specified messages.
      Parameters:
      messageNames - the names of the message the process instance is expected to be waiting for
      Returns:
      this ProcessInstanceAssert
    • isNotWaitingFor

      public ProcessInstanceAssert isNotWaitingFor(String... messageNames)
      Verifies the expectation that the ProcessInstance is currently waiting for one or more specified messages.
      Parameters:
      messageNames - the names of the message the process instance is expected to be waiting for
      Returns:
      this ProcessInstanceAssert
    • hasPassed

      public ProcessInstanceAssert hasPassed(String... activityIds)
      Verifies the expectation that the ProcessInstance has passed one or more specified activities.
      Parameters:
      activityIds - the id's of the activities expected to have been passed
      Returns:
      this ProcessInstanceAssert
    • hasPassedInOrder

      public ProcessInstanceAssert hasPassedInOrder(String... activityIds)
      Verifies the expectation that the ProcessInstance has passed one or more specified activities exactly in the given order. Note that this can not be guaranteed for instances of concurrent activities (see orderPartiallyByOccurrence for details).
      Parameters:
      activityIds - the id's of the activities expected to have been passed
      Returns:
      this ProcessInstanceAssert
    • hasNotPassed

      public ProcessInstanceAssert hasNotPassed(String... activityIds)
      Verifies the expectation that the ProcessInstance has NOT passed one or more specified activities.
      Parameters:
      activityIds - the id's of the activities expected NOT to have been passed
      Returns:
      this ProcessInstanceAssert
    • hasVariables

      public ProcessInstanceAssert hasVariables(String... names)
      Verifies the expectation that the ProcessInstance holds one or more process variables with the specified names.
      Parameters:
      names - the names of the process variables expected to exist. In case no variable name is given, the existence of at least one variable will be verified.
      Returns:
      this ProcessInstanceAssert
    • hasNoVariables

      public ProcessInstanceAssert hasNoVariables()
      Verifies the expectation that the ProcessInstance holds no process variables at all.
      Returns:
      this ProcessInstanceAssert
    • hasProcessDefinitionKey

      public ProcessInstanceAssert hasProcessDefinitionKey(String processDefinitionKey)
      Verifies the expectation that the ProcessInstance has the given processDefinitionKey.
      Parameters:
      processDefinitionKey - the expected key
      Returns:
      this ProcessInstanceAssert
    • hasBusinessKey

      public ProcessInstanceAssert hasBusinessKey(String businessKey)
      Verifies the expectation that the ProcessInstance has the given businessKey.
      Parameters:
      businessKey - the expected key
      Returns:
      this ProcessInstanceAssert
    • isEnded

      public ProcessInstanceAssert isEnded()
      Verifies the expectation that the ProcessInstance is ended.
      Returns:
      this ProcessInstanceAssert
    • isSuspended

      public ProcessInstanceAssert isSuspended()
      Verifies the expectation that the ProcessInstance is currently suspended.
      Returns:
      this ProcessInstanceAssert
    • isNotEnded

      public ProcessInstanceAssert isNotEnded()
      Verifies the expectation that the ProcessInstance is not ended.
      Returns:
      this ProcessInstanceAssert
    • isActive

      public ProcessInstanceAssert isActive()
      Verifies the expectation that the ProcessInstance is currently active, iow not suspended and not ended.
      Returns:
      this ProcessInstanceAssert
    • isStarted

      public ProcessInstanceAssert isStarted()
      Verifies the expectation that the ProcessInstance is started. This is also true, in case the process instance already ended.
      Returns:
      this ProcessInstanceAssert
    • task

      public TaskAssert task()
      Enter into a chained task assert inspecting the one and mostly one task currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Returns:
      TaskAssert inspecting the only task available. Inspecting a 'null' Task in case no such Task is available.
      Throws:
      ProcessEngineException - in case more than one task is delivered by the query (after being narrowed to actual ProcessInstance)
    • task

      public TaskAssert task(String taskDefinitionKey)
      Enter into a chained task assert inspecting the one and mostly one task of the specified task definition key currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Parameters:
      taskDefinitionKey - definition key narrowing down the search for tasks
      Returns:
      TaskAssert inspecting the only task available. Inspecting a 'null' Task in case no such Task is available.
      Throws:
      ProcessEngineException - in case more than one task is delivered by the query (after being narrowed to actual ProcessInstance)
    • task

      public TaskAssert task(TaskQuery query)
      Enter into a chained task assert inspecting only tasks currently available in the context of the process instance under test of this ProcessInstanceAssert. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Parameters:
      query - TaskQuery further narrowing down the search for tasks The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Returns:
      TaskAssert inspecting the only task resulting from the given search. Inspecting a 'null' Task in case no such Task is available.
      Throws:
      ProcessEngineException - in case more than one task is delivered by the query (after being narrowed to actual ProcessInstance)
    • externalTask

      public ExternalTaskAssert externalTask()
      Enter into a chained external task assert inspecting the one and mostly one external task currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Returns:
      ExternalTaskAssert inspecting the only external task available. Inspecting a 'null' external task in case no such external task is available.
      Throws:
      ProcessEngineException - in case more than one external task is delivered by the query (after being narrowed to actual ProcessInstance)
    • externalTask

      public ExternalTaskAssert externalTask(String activityId)
      Enter into a chained external task assert inspecting the one and mostly one external task of the specified activity id currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Parameters:
      activityId - activity id narrowing down the search for external tasks
      Returns:
      ExternalTaskAssert inspecting the only external task available. Inspecting a 'null' external task in case no such external task is available.
      Throws:
      ProcessEngineException - in case more than one external task is delivered by the query (after being narrowed to actual ProcessInstance)
    • externalTask

      public ExternalTaskAssert externalTask(ExternalTaskQuery query)
      Enter into a chained external task assert inspecting only external tasks currently available in the context of the process instance under test of this ProcessInstanceAssert. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Parameters:
      query - ExternalTaskQuery further narrowing down the search for external tasks. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Returns:
      ExternalTaskAssert inspecting the only external task resulting from the given search. Inspecting a 'null' external task in case no such external task is available.
      Throws:
      ProcessEngineException - in case more than one external task is delivered by the query (after being narrowed to actual ProcessInstance)
    • calledProcessInstance

      public ProcessInstanceAssert calledProcessInstance()
      Enter into a chained process instance assert inspecting the one and mostly one called process instance currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Returns:
      ProcessInstanceAssert inspecting the only called process instance available. Inspecting a 'null' process instance in case no such Task is available.
      Throws:
      ProcessEngineException - in case more than one process instance is delivered by the query (after being narrowed to actual ProcessInstance)
    • calledProcessInstance

      public ProcessInstanceAssert calledProcessInstance(String processDefinitionKey)
      Enter into a chained process instance assert inspecting the one and mostly one called process instance of the specified process definition key currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Parameters:
      processDefinitionKey - definition key narrowing down the search for process instances
      Returns:
      ProcessInstanceAssert inspecting the only such process instance available. Inspecting a 'null' ProcessInstance in case no such ProcessInstance is available.
      Throws:
      ProcessEngineException - in case more than one process instance is delivered by the query (after being narrowed to actual ProcessInstance)
    • calledProcessInstance

      public ProcessInstanceAssert calledProcessInstance(ProcessInstanceQuery query)
      Enter into a chained process instance assert inspecting a called process instance called by and currently available in the context of the process instance under test of this ProcessInstanceAssert. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Parameters:
      query - ProcessDefinitionQuery further narrowing down the search for process instances. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Returns:
      ProcessInstanceAssert inspecting the only such process instance resulting from the given search. Inspecting a 'null' ProcessInstance in case no such ProcessInstance is available.
      Throws:
      ProcessEngineException - in case more than one ProcessInstance is delivered by the query (after being narrowed to actual ProcessInstance)
    • job

      public JobAssert job()
      Enter into a chained job assert inspecting the one and mostly one job currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Returns:
      JobAssert inspecting the only job available. Inspecting a 'null' Job in case no such Job is available.
      Throws:
      ProcessEngineException - in case more than one task is delivered by the query (after being narrowed to actual ProcessInstance)
    • job

      public JobAssert job(String activityId)
      Enter into a chained task assert inspecting the one and mostly one task of the specified task definition key currently available in the context of the process instance under test of this ProcessInstanceAssert.
      Parameters:
      activityId - id narrowing down the search for jobs
      Returns:
      JobAssert inspecting the retrieved job. Inspecting a 'null' Task in case no such Job is available.
      Throws:
      ProcessEngineException - in case more than one job is delivered by the query (after being narrowed to actual ProcessInstance)
    • job

      public JobAssert job(JobQuery query)
      Enter into a chained job assert inspecting only jobs currently available in the context of the process instance under test of this ProcessInstanceAssert. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Parameters:
      query - JobQuery further narrowing down the search for jobs. The query is automatically narrowed down to the actual ProcessInstance under test of this assertion.
      Returns:
      JobAssert inspecting the only job resulting from the given search. Inspecting a 'null' job in case no such job is available.
      Throws:
      ProcessEngineException - in case more than one job is delivered by the query (after being narrowed to actual ProcessInstance)
    • variables

      public org.assertj.core.api.MapAssert<String,Object> variables()
      Enter into a chained map assert inspecting the variables currently - or, for finished process instances, historically - available in the context of the process instance under test of this ProcessInstanceAssert.
      Returns:
      MapAssert(String, Object) inspecting the process variables. Inspecting an empty map in case no such variables are available.
    • vars

      protected Map<String,Object> vars()
    • taskQuery

      protected TaskQuery taskQuery()
      Overrides:
      taskQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • externalTaskQuery

      protected ExternalTaskQuery externalTaskQuery()
      Overrides:
      externalTaskQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • jobQuery

      protected JobQuery jobQuery()
      Overrides:
      jobQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • processInstanceQuery

      protected ProcessInstanceQuery processInstanceQuery()
      Overrides:
      processInstanceQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • executionQuery

      protected ExecutionQuery executionQuery()
      Overrides:
      executionQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • historicActivityInstanceQuery

      protected HistoricActivityInstanceQuery historicActivityInstanceQuery()
      Overrides:
      historicActivityInstanceQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • historicProcessInstanceQuery

      protected HistoricProcessInstanceQuery historicProcessInstanceQuery()
      Overrides:
      historicProcessInstanceQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • historicVariableInstanceQuery

      protected HistoricVariableInstanceQuery historicVariableInstanceQuery()
      Overrides:
      historicVariableInstanceQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
    • processDefinitionQuery

      protected ProcessDefinitionQuery processDefinitionQuery()
      Overrides:
      processDefinitionQuery in class AbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>