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 aProcessInstance
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static AssertionsLogger
LOG
-
Fields inherited from class org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert
engine
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProcessInstanceAssert(ProcessEngine engine, ProcessInstance actual)
protected
ProcessInstanceAssert(ProcessEngine engine, ProcessInstance actual, Class<?> selfType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static ProcessInstanceAssert
assertThat(ProcessEngine engine, ProcessInstance actual)
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(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
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.protected ExecutionQuery
executionQuery()
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.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.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.protected ExternalTaskQuery
externalTaskQuery()
protected ProcessInstance
getCurrent()
ProcessInstanceAssert
hasBusinessKey(String businessKey)
Verifies the expectation that theProcessInstance
has the given businessKey.ProcessInstanceAssert
hasNotPassed(String... activityIds)
Verifies the expectation that theProcessInstance
has NOT passed one or more specified activities.ProcessInstanceAssert
hasNoVariables()
Verifies the expectation that theProcessInstance
holds no process variables at all.ProcessInstanceAssert
hasPassed(String... activityIds)
Verifies the expectation that theProcessInstance
has passed one or more specified activities.ProcessInstanceAssert
hasPassedInOrder(String... activityIds)
Verifies the expectation that theProcessInstance
has passed one or more specified activities exactly in the given order.ProcessInstanceAssert
hasProcessDefinitionKey(String processDefinitionKey)
Verifies the expectation that theProcessInstance
has the given processDefinitionKey.ProcessInstanceAssert
hasVariables(String... names)
Verifies the expectation that theProcessInstance
holds one or more process variables with the specified names.protected HistoricActivityInstanceQuery
historicActivityInstanceQuery()
protected HistoricProcessInstanceQuery
historicProcessInstanceQuery()
protected HistoricVariableInstanceQuery
historicVariableInstanceQuery()
ProcessInstanceAssert
isActive()
Verifies the expectation that theProcessInstance
is currently active, iow not suspended and not ended.ProcessInstanceAssert
isEnded()
Verifies the expectation that theProcessInstance
is ended.ProcessInstanceAssert
isNotEnded()
Verifies the expectation that theProcessInstance
is not ended.ProcessInstanceAssert
isNotWaitingAt(String... activityIds)
Verifies the expectation that theProcessInstance
is currently NOT waiting at one or more specified activities.ProcessInstanceAssert
isNotWaitingFor(String... messageNames)
Verifies the expectation that theProcessInstance
is currently waiting for one or more specified messages.ProcessInstanceAssert
isStarted()
Verifies the expectation that theProcessInstance
is started.ProcessInstanceAssert
isSuspended()
Verifies the expectation that theProcessInstance
is currently suspended.ProcessInstanceAssert
isWaitingAt(String... activityIds)
Verifies the expectation that theProcessInstance
is currently waiting at one or more specified activities.ProcessInstanceAssert
isWaitingAtExactly(String... activityIds)
Verifies the expectation that theProcessInstance
is currently waiting at exactly one or more specified activities.ProcessInstanceAssert
isWaitingFor(String... messageNames)
Verifies the expectation that theProcessInstance
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(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.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.protected JobQuery
jobQuery()
protected ProcessDefinitionQuery
processDefinitionQuery()
protected ProcessInstanceQuery
processInstanceQuery()
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(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.protected TaskQuery
taskQuery()
protected String
toString(ProcessInstance processInstance)
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.protected Map<String,Object>
vars()
-
Methods inherited from class org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert
caseDefinitionQuery, caseExecutionQuery, caseInstanceQuery, caseService, externalTaskService, formService, getActual, getExistingCurrent, getLastAssert, historicCaseActivityInstanceQuery, historyService, managementService, repositoryService, resetLastAsserts, runtimeService, taskService
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Field Detail
-
LOG
protected static final AssertionsLogger LOG
-
-
Constructor Detail
-
ProcessInstanceAssert
protected ProcessInstanceAssert(ProcessEngine engine, ProcessInstance actual)
-
ProcessInstanceAssert
protected ProcessInstanceAssert(ProcessEngine engine, ProcessInstance actual, Class<?> selfType)
-
-
Method Detail
-
assertThat
protected static ProcessInstanceAssert assertThat(ProcessEngine engine, ProcessInstance actual)
-
getCurrent
protected ProcessInstance getCurrent()
- Specified by:
getCurrent
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
toString
protected String toString(ProcessInstance processInstance)
- Specified by:
toString
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
isWaitingAt
public ProcessInstanceAssert isWaitingAt(String... activityIds)
Verifies the expectation that theProcessInstance
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 theProcessInstance
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 theProcessInstance
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 theProcessInstance
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 theProcessInstance
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 theProcessInstance
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 theProcessInstance
has passed one or more specified activities exactly in the given order. Note that this can not be guaranteed for instances of concurrent activities (seeorderPartiallyByOccurrence
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 theProcessInstance
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 theProcessInstance
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 theProcessInstance
holds no process variables at all.- Returns:
- this
ProcessInstanceAssert
-
hasProcessDefinitionKey
public ProcessInstanceAssert hasProcessDefinitionKey(String processDefinitionKey)
Verifies the expectation that theProcessInstance
has the given processDefinitionKey.- Parameters:
processDefinitionKey
- the expected key- Returns:
- this
ProcessInstanceAssert
-
hasBusinessKey
public ProcessInstanceAssert hasBusinessKey(String businessKey)
Verifies the expectation that theProcessInstance
has the given businessKey.- Parameters:
businessKey
- the expected key- Returns:
- this
ProcessInstanceAssert
-
isEnded
public ProcessInstanceAssert isEnded()
Verifies the expectation that theProcessInstance
is ended.- Returns:
- this
ProcessInstanceAssert
-
isSuspended
public ProcessInstanceAssert isSuspended()
Verifies the expectation that theProcessInstance
is currently suspended.- Returns:
- this
ProcessInstanceAssert
-
isNotEnded
public ProcessInstanceAssert isNotEnded()
Verifies the expectation that theProcessInstance
is not ended.- Returns:
- this
ProcessInstanceAssert
-
isActive
public ProcessInstanceAssert isActive()
Verifies the expectation that theProcessInstance
is currently active, iow not suspended and not ended.- Returns:
- this
ProcessInstanceAssert
-
isStarted
public ProcessInstanceAssert isStarted()
Verifies the expectation that theProcessInstance
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.
-
taskQuery
protected TaskQuery taskQuery()
- Overrides:
taskQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
externalTaskQuery
protected ExternalTaskQuery externalTaskQuery()
- Overrides:
externalTaskQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
jobQuery
protected JobQuery jobQuery()
- Overrides:
jobQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
processInstanceQuery
protected ProcessInstanceQuery processInstanceQuery()
- Overrides:
processInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
executionQuery
protected ExecutionQuery executionQuery()
- Overrides:
executionQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
historicActivityInstanceQuery
protected HistoricActivityInstanceQuery historicActivityInstanceQuery()
- Overrides:
historicActivityInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
historicProcessInstanceQuery
protected HistoricProcessInstanceQuery historicProcessInstanceQuery()
- Overrides:
historicProcessInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
historicVariableInstanceQuery
protected HistoricVariableInstanceQuery historicVariableInstanceQuery()
- Overrides:
historicVariableInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
processDefinitionQuery
protected ProcessDefinitionQuery processDefinitionQuery()
- Overrides:
processDefinitionQuery
in classAbstractProcessAssert<ProcessInstanceAssert,ProcessInstance>
-
-