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 Summary
Fields inherited from class org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert
engine
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
ModifierConstructorDescriptionprotected
ProcessInstanceAssert
(ProcessEngine engine, ProcessInstance actual) protected
ProcessInstanceAssert
(ProcessEngine engine, ProcessInstance actual, Class<?> selfType) -
Method Summary
Modifier and TypeMethodDescriptionprotected static ProcessInstanceAssert
assertThat
(ProcessEngine engine, ProcessInstance actual) 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.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.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
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.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.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
protected ProcessInstance
hasBusinessKey
(String businessKey) Verifies the expectation that theProcessInstance
has the given businessKey.hasNotPassed
(String... activityIds) Verifies the expectation that theProcessInstance
has NOT passed one or more specified activities.Verifies the expectation that theProcessInstance
holds no process variables at all.Verifies the expectation that theProcessInstance
has passed one or more specified activities.hasPassedInOrder
(String... activityIds) Verifies the expectation that theProcessInstance
has passed one or more specified activities exactly in the given order.hasProcessDefinitionKey
(String processDefinitionKey) Verifies the expectation that theProcessInstance
has the given processDefinitionKey.hasVariables
(String... names) Verifies the expectation that theProcessInstance
holds one or more process variables with the specified names.protected HistoricActivityInstanceQuery
protected HistoricProcessInstanceQuery
protected HistoricVariableInstanceQuery
isActive()
Verifies the expectation that theProcessInstance
is currently active, iow not suspended and not ended.isEnded()
Verifies the expectation that theProcessInstance
is ended.Verifies the expectation that theProcessInstance
is not ended.isNotWaitingAt
(String... activityIds) Verifies the expectation that theProcessInstance
is currently NOT waiting at one or more specified activities.isNotWaitingFor
(String... messageNames) Verifies the expectation that theProcessInstance
is currently waiting for one or more specified messages.Verifies the expectation that theProcessInstance
is started.Verifies the expectation that theProcessInstance
is currently suspended.isWaitingAt
(String... activityIds) Verifies the expectation that theProcessInstance
is currently waiting at one or more specified activities.isWaitingAtExactly
(String... activityIds) Verifies the expectation that theProcessInstance
is currently waiting at exactly one or more specified activities.isWaitingFor
(String... messageNames) Verifies the expectation that theProcessInstance
is currently waiting for one or more specified messages.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.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.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
protected ProcessInstanceQuery
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.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.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
protected String
toString
(ProcessInstance processInstance) 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.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
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, 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, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Field Details
-
LOG
-
-
Constructor Details
-
ProcessInstanceAssert
-
ProcessInstanceAssert
-
-
Method Details
-
assertThat
-
getCurrent
- Specified by:
getCurrent
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
toString
- Specified by:
toString
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
isWaitingAt
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
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
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
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
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
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
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
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
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
Verifies the expectation that theProcessInstance
holds no process variables at all.- Returns:
- this
ProcessInstanceAssert
-
hasProcessDefinitionKey
Verifies the expectation that theProcessInstance
has the given processDefinitionKey.- Parameters:
processDefinitionKey
- the expected key- Returns:
- this
ProcessInstanceAssert
-
hasBusinessKey
Verifies the expectation that theProcessInstance
has the given businessKey.- Parameters:
businessKey
- the expected key- Returns:
- this
ProcessInstanceAssert
-
isEnded
Verifies the expectation that theProcessInstance
is ended.- Returns:
- this
ProcessInstanceAssert
-
isSuspended
Verifies the expectation that theProcessInstance
is currently suspended.- Returns:
- this
ProcessInstanceAssert
-
isNotEnded
Verifies the expectation that theProcessInstance
is not ended.- Returns:
- this
ProcessInstanceAssert
-
isActive
Verifies the expectation that theProcessInstance
is currently active, iow not suspended and not ended.- Returns:
- this
ProcessInstanceAssert
-
isStarted
Verifies the expectation that theProcessInstance
is started. This is also true, in case the process instance already ended.- Returns:
- this
ProcessInstanceAssert
-
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
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
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
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
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
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
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
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
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
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
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
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
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
-
taskQuery
- Overrides:
taskQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
externalTaskQuery
- Overrides:
externalTaskQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
jobQuery
- Overrides:
jobQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
processInstanceQuery
- Overrides:
processInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
executionQuery
- Overrides:
executionQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
historicActivityInstanceQuery
- Overrides:
historicActivityInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
historicProcessInstanceQuery
- Overrides:
historicProcessInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
historicVariableInstanceQuery
- Overrides:
historicVariableInstanceQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-
processDefinitionQuery
- Overrides:
processDefinitionQuery
in classAbstractProcessAssert<ProcessInstanceAssert,
ProcessInstance>
-