.behavior(new TaskWaitState())
.endActivity()
.buildCaseDefinition();
// create a new case instance
CmmnCaseInstance caseInstance = caseDefinition.createCaseInstance();
caseInstance.create();
// expected state transitions after creation of a case instance:
// () --create(Case1)--> active
// () --create(A)--> available
// available --enable(A)--> enabled
List<String> expectedStateTransitions = new ArrayList<String>();
expectedStateTransitions.add("() --create(Case1)--> active");
expectedStateTransitions.add("() --create(A)--> available");
expectedStateTransitions.add("available --enable(A)--> enabled");
assertEquals(expectedStateTransitions, stateTransitionCollector.stateTransitions);
// clear lists
expectedStateTransitions.clear();
stateTransitionCollector.stateTransitions.clear();
// case instance is active
assertTrue(caseInstance.isActive());
CaseExecutionImpl instance = (CaseExecutionImpl) caseInstance;
// case instance has one child plan item
List<CaseExecutionImpl> childPlanItems = instance.getCaseExecutions();