org.camunda.bpm.engine.test.assertions
Class ProcessInstanceAssert

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

public class ProcessInstanceAssert
extends AbstractProcessAssert<ProcessInstanceAssert,org.camunda.bpm.engine.runtime.ProcessInstance>

Assertions for a ProcessInstance

Author:
Martin Schimak , Rafael Cordones

Method Summary
 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.
 ProcessInstanceAssert calledProcessInstance(org.camunda.bpm.engine.runtime.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.
 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.
 ProcessInstanceAssert hasNotPassed(String... activityIds)
          Verifies the expectation that the ProcessInstance has NOT passed one or more specified activities.
 ProcessInstanceAssert hasNoVariables()
          Verifies the expectation that the ProcessInstance holds no process variables at all.
 ProcessInstanceAssert hasPassed(String... activityIds)
          Verifies the expectation that the ProcessInstance has passed one or more specified activities.
 ProcessInstanceAssert hasPassedInOrder(String... activityIds)
          Verifies the expectation that the ProcessInstance has passed one or more specified activities exactly in the given order.
 ProcessInstanceAssert hasProcessDefinitionKey(String processDefinitionKey)
          Verifies the expectation that the ProcessInstance has the given processDefinitionKey.
 ProcessInstanceAssert hasVariables(String... names)
          Verifies the expectation that the ProcessInstance holds one or more process variables with the specified names.
 ProcessInstanceAssert isActive()
          Verifies the expectation that the ProcessInstance is currently active, iow not suspended and not ended.
 ProcessInstanceAssert isEnded()
          Verifies the expectation that the ProcessInstance is ended.
 ProcessInstanceAssert isNotEnded()
          Verifies the expectation that the ProcessInstance is not ended.
 ProcessInstanceAssert isNotWaitingAt(String... activityIds)
          Verifies the expectation that the ProcessInstance is currently NOT waiting at one or more specified activities.
 ProcessInstanceAssert isNotWaitingFor(String... messageNames)
          Verifies the expectation that the ProcessInstance is currently waiting for one or more specified messages.
 ProcessInstanceAssert isStarted()
          Verifies the expectation that the ProcessInstance is started.
 ProcessInstanceAssert isSuspended()
          Verifies the expectation that the ProcessInstance is currently suspended.
 ProcessInstanceAssert isWaitingAt(String... activityIds)
          Verifies the expectation that the ProcessInstance is currently waiting at one or more specified activities.
 ProcessInstanceAssert isWaitingAtExactly(String... activityIds)
          Verifies the expectation that the ProcessInstance is currently waiting at exactly one or more specified activities.
 ProcessInstanceAssert isWaitingFor(String... messageNames)
          Verifies the expectation that the ProcessInstance is currently waiting for one or more specified messages.
 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.
 JobAssert job(org.camunda.bpm.engine.runtime.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.
 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.
 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.
 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.
 TaskAssert task(org.camunda.bpm.engine.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.
 org.assertj.core.api.MapAssert<String,Object> variables()
          Enter into a chained map assert inspecting the variables currently available in the context of the process instance under test of this ProcessInstanceAssert.
 
Methods inherited from class org.camunda.bpm.engine.test.assertions.AbstractProcessAssert
getActual, getLastAssert, resetLastAsserts
 
Methods inherited from class org.assertj.core.api.AbstractAssert
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, has, hashCode, hasSameClassAs, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, usingComparator, usingDefaultComparator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.

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

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:
org.camunda.bpm.engine.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:
org.camunda.bpm.engine.ProcessEngineException - in case more than one task is delivered by the query (after being narrowed to actual ProcessInstance)

task

public TaskAssert task(org.camunda.bpm.engine.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:
org.camunda.bpm.engine.ProcessEngineException - in case more than one 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:
org.camunda.bpm.engine.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:
org.camunda.bpm.engine.ProcessEngineException - in case more than one process instance is delivered by the query (after being narrowed to actual ProcessInstance)

calledProcessInstance

public ProcessInstanceAssert calledProcessInstance(org.camunda.bpm.engine.runtime.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:
org.camunda.bpm.engine.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:
org.camunda.bpm.engine.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:
org.camunda.bpm.engine.ProcessEngineException - in case more than one job is delivered by the query (after being narrowed to actual ProcessInstance)

job

public JobAssert job(org.camunda.bpm.engine.runtime.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:
org.camunda.bpm.engine.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 available in the context of the process instance under test of this ProcessInstanceAssert.

Returns:
MapAssert inspecting the process variables. Inspecting a 'null' map in case no such variables are available.


Copyright © 2014 camunda services GmbH. All Rights Reserved.