Class AbstractCaseAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<S,A>
-
- org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert<S,A>
-
- org.camunda.bpm.engine.test.assertions.cmmn.AbstractCaseAssert<S,A>
-
- All Implemented Interfaces:
org.assertj.core.api.Assert<S,A>
,org.assertj.core.api.Descriptable<S>
,org.assertj.core.api.ExtensionPoints<S,A>
- Direct Known Subclasses:
CaseExecutionAssert
,CaseInstanceAssert
,CaseTaskAssert
,HumanTaskAssert
,MilestoneAssert
,ProcessTaskAssert
,StageAssert
public abstract class AbstractCaseAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution> extends AbstractProcessAssert<S,A>
-
-
Field Summary
-
Fields inherited from class org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert
engine
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCaseAssert(ProcessEngine engine, A actual, Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CaseExecutionAssert
caseExecution(CaseExecutionQuery query)
Retrieve a childCaseExecution
currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected CaseExecutionQuery
caseExecutionQuery()
CaseExecutionQuery, automatically narrowed toCaseInstance
of actualCaseExecution
protected CaseTaskAssert
caseTask(String activityId)
Enter into a chainedCaseTaskAssert
inspecting the one and mostly one 'caseTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected CaseTaskAssert
caseTask(CaseExecutionQuery query)
Enter into a chainedCaseTaskAssert
inspecting the one and mostly one 'caseTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected CaseExecutionAssert
descendantCaseExecution(CaseExecutionQuery query)
Retrieve any descendantCaseExecution
currently available in the context of the actual caseInstance under test of this AbstractCaseAssert.A
getActual()
Delivers the the actual object under test.protected A
getCurrent()
Retrieve refreshed status of object under test from runtime databaseprotected int
getHistoricState()
protected S
hasVars(String[] names)
protected HistoricCaseActivityInstanceQuery
historicCaseActivityInstanceQuery()
HistoricCaseActivityInstanceQuery, automatically narrowed toCaseInstance
of actualCaseExecution
protected HumanTaskAssert
humanTask(String activityId)
Enter into a chainedHumanTaskAssert
inspecting the one and mostly one 'humanTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected HumanTaskAssert
humanTask(CaseExecutionQuery query)
Enter into a chainedHumanTaskAssert
inspecting the one and mostly one 'humanTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected S
isActive()
Verifies the expectation that theCaseExecution
is 'active'.protected S
isAvailable()
Verifies the expectation that theCaseExecution
is 'available'.protected CaseInstanceAssert
isCaseInstance()
Verifies the expectation that theCaseExecution
is the 'case' instance.protected CaseTaskAssert
isCaseTask()
Verifies the expectation that theCaseExecution
is a 'caseTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes senseprotected S
isClosed()
Verifies the expectation that theCaseExecution
is 'closed'.protected S
isCompleted()
Verifies the expectation that theCaseExecution
is 'completed'.protected S
isDisabled()
Verifies the expectation that theCaseExecution
is 'disabled'.protected S
isEnabled()
Verifies the expectation that theCaseExecution
is 'enabled'.protected HumanTaskAssert
isHumanTask()
Verifies the expectation that theCaseExecution
is a 'humanTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes senseprotected MilestoneAssert
isMilestone()
Verifies the expectation that theCaseExecution
is a 'milestone' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes senseprotected ProcessTaskAssert
isProcessTask()
Verifies the expectation that theCaseExecution
is a 'processTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes senseprotected StageAssert
isStage()
Verifies the expectation that theCaseExecution
is a 'stage' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes senseprotected S
isTerminated()
Verifies the expectation that theCaseExecution
is 'terminated'.protected MilestoneAssert
milestone(String activityId)
Enter into a chainedMilestoneAssert
inspecting the one and mostly one 'milestone' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected MilestoneAssert
milestone(CaseExecutionQuery query)
Enter into a chainedMilestoneAssert
inspecting the one and mostly one 'milestone' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected ProcessTaskAssert
processTask(String activityId)
Enter into a chainedProcessTaskAssert
inspecting the one and mostly one 'processTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected ProcessTaskAssert
processTask(CaseExecutionQuery query)
Enter into a chainedProcessTaskAssert
inspecting the one and mostly one 'processTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected StageAssert
stage(String activityId)
Enter into a chainedStageAssert
inspecting the one and mostly one 'stage' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected StageAssert
stage(CaseExecutionQuery query)
Enter into a chainedStageAssert
inspecting the one and mostly one 'stage' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert.protected String
toString(A caseExecution)
protected org.assertj.core.api.MapAssert<String,Object>
variables()
Enter into a chained map assert inspecting the variables currently available in the context of the case instance under test of this AbstractCaseAssert.protected Map<String,Object>
vars()
-
Methods inherited from class org.camunda.bpm.engine.test.assertions.bpmn.AbstractProcessAssert
caseDefinitionQuery, caseInstanceQuery, caseService, executionQuery, externalTaskQuery, externalTaskService, formService, getExistingCurrent, getLastAssert, historicActivityInstanceQuery, historicProcessInstanceQuery, historicVariableInstanceQuery, historyService, jobQuery, managementService, processDefinitionQuery, processInstanceQuery, repositoryService, resetLastAsserts, runtimeService, taskQuery, 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
-
-
-
-
Constructor Detail
-
AbstractCaseAssert
protected AbstractCaseAssert(ProcessEngine engine, A actual, Class<?> selfType)
-
-
Method Detail
-
getActual
public A getActual()
Delivers the the actual object under test.- Overrides:
getActual
in classAbstractProcessAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
-
isAvailable
protected S isAvailable()
Verifies the expectation that theCaseExecution
is 'available'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isEnabled
protected S isEnabled()
Verifies the expectation that theCaseExecution
is 'enabled'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isDisabled
protected S isDisabled()
Verifies the expectation that theCaseExecution
is 'disabled'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isActive
protected S isActive()
Verifies the expectation that theCaseExecution
is 'active'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isCompleted
protected S isCompleted()
Verifies the expectation that theCaseExecution
is 'completed'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isClosed
protected S isClosed()
Verifies the expectation that theCaseExecution
is 'closed'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isTerminated
protected S isTerminated()
Verifies the expectation that theCaseExecution
is 'terminated'. Change visibility to public for those inheriting classes for whose underlying objects under test this status makes sense- Returns:
- this
-
isCaseInstance
protected CaseInstanceAssert isCaseInstance()
Verifies the expectation that theCaseExecution
is the 'case' instance. Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
isStage
protected StageAssert isStage()
Verifies the expectation that theCaseExecution
is a 'stage' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
isHumanTask
protected HumanTaskAssert isHumanTask()
Verifies the expectation that theCaseExecution
is a 'humanTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
isProcessTask
protected ProcessTaskAssert isProcessTask()
Verifies the expectation that theCaseExecution
is a 'processTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
isCaseTask
protected CaseTaskAssert isCaseTask()
Verifies the expectation that theCaseExecution
is a 'caseTask' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
isMilestone
protected MilestoneAssert isMilestone()
Verifies the expectation that theCaseExecution
is a 'milestone' Change visibility to public for those inheriting classes for whose underlying objects under test this assertion makes sense- Returns:
- this
-
caseExecution
protected CaseExecutionAssert caseExecution(CaseExecutionQuery query)
Retrieve a childCaseExecution
currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion.- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)- See Also:
to find grandchilds and other descendants, too.
-
descendantCaseExecution
protected CaseExecutionAssert descendantCaseExecution(CaseExecutionQuery query)
Retrieve any descendantCaseExecution
currently available in the context of the actual caseInstance under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion.- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)- See Also:
to find only children of this
-
humanTask
protected HumanTaskAssert humanTask(CaseExecutionQuery query)
Enter into a chainedHumanTaskAssert
inspecting the one and mostly one 'humanTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'humanTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'humanTask'.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
humanTask
protected HumanTaskAssert humanTask(String activityId)
Enter into a chainedHumanTaskAssert
inspecting the one and mostly one 'humanTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'humanTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
activityId
- activity if further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'humanTask'.- Returns:
- the only CaseExecution with the given activitiy id. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
caseTask
protected CaseTaskAssert caseTask(CaseExecutionQuery query)
Enter into a chainedCaseTaskAssert
inspecting the one and mostly one 'caseTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'caseTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'caseTask'.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
caseTask
protected CaseTaskAssert caseTask(String activityId)
Enter into a chainedCaseTaskAssert
inspecting the one and mostly one 'caseTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'caseTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
activityId
- activity if further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'caseTask'.- Returns:
- the only CaseExecution with the given activitiy id. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
processTask
protected ProcessTaskAssert processTask(CaseExecutionQuery query)
Enter into a chainedProcessTaskAssert
inspecting the one and mostly one 'processTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'processTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'processTask'.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
processTask
protected ProcessTaskAssert processTask(String activityId)
Enter into a chainedProcessTaskAssert
inspecting the one and mostly one 'processTask' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'processTask'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
activityId
- activity if further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'processTask'.- Returns:
- the only CaseExecution with the given activitiy id. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
stage
protected StageAssert stage(CaseExecutionQuery query)
Enter into a chainedStageAssert
inspecting the one and mostly one 'stage' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'stage'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'stage'.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
stage
protected StageAssert stage(String activityId)
Enter into a chainedStageAssert
inspecting the one and mostly one 'stage' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'stage'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
activityId
- activity if further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'stage'.- Returns:
- the only CaseExecution with the given activitiy id. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
milestone
protected MilestoneAssert milestone(CaseExecutionQuery query)
Enter into a chainedMilestoneAssert
inspecting the one and mostly one 'milestone' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'milestone'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
query
- CaseExecutionQuery further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'milestone'.- Returns:
- the only CaseExecution resulting from the given search. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
milestone
protected MilestoneAssert milestone(String activityId)
Enter into a chainedMilestoneAssert
inspecting the one and mostly one 'milestone' currently available in the context of the actual caseExecution under test of this AbstractCaseAssert. The query is automatically narrowed down to the actual caseExecution under test of this assertion as well as to the type 'milestone'. Change visibility to public for those inheriting classes for whose underlying objects under test this method makes sense- Parameters:
activityId
- activity if further narrowing down the search for caseExecutions. The query is automatically narrowed down to the actual 'parent' CaseExecution under test of this assertion as well as to the type 'milestone'.- Returns:
- the only CaseExecution with the given activitiy id. A 'null' CaseExecution in case no such CaseExecution is available.
- Throws:
ProcessEngineException
- in case more than one CaseExecution is delivered by the query (after being narrowed to the actual 'parent' CaseExecution)
-
getCurrent
protected A getCurrent()
Retrieve refreshed status of object under test from runtime database- Specified by:
getCurrent
in classAbstractProcessAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
-
getHistoricState
protected int getHistoricState()
- Returns:
- historic state for the object under test from history database
-
caseExecutionQuery
protected CaseExecutionQuery caseExecutionQuery()
CaseExecutionQuery, automatically narrowed toCaseInstance
of actualCaseExecution
- Overrides:
caseExecutionQuery
in classAbstractProcessAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
-
historicCaseActivityInstanceQuery
protected HistoricCaseActivityInstanceQuery historicCaseActivityInstanceQuery()
HistoricCaseActivityInstanceQuery, automatically narrowed toCaseInstance
of actualCaseExecution
- Overrides:
historicCaseActivityInstanceQuery
in classAbstractProcessAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
-
toString
protected String toString(A caseExecution)
- Specified by:
toString
in classAbstractProcessAssert<S extends AbstractCaseAssert<S,A>,A extends CaseExecution>
-
variables
protected org.assertj.core.api.MapAssert<String,Object> variables()
Enter into a chained map assert inspecting the variables currently available in the context of the case instance under test of this AbstractCaseAssert.- Returns:
- MapAssert(String, Object) inspecting the case instance variables. Inspecting an empty map in case no such variables are available.
-
-