use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryScenarioTest method testNewSentryInstance.
@Test
@ScenarioUnderTest("newSentryInstance.1")
public void testNewSentryInstance() {
// given
String secondStageId = rule.caseExecutionQuery().activityId("PI_Stage_2").singleResult().getId();
// when
// start human task
caseService.manuallyStartCaseExecution(secondStageId);
// then
// a new sentry instance should be created
CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().caseExecutionId(secondStageId).singleResult();
assertNotNull(sentryPart);
assertFalse(sentryPart.isSatisfied());
assertNull(sentryPart.getSourceCaseExecutionId());
assertEquals("PI_HumanTask_1", sentryPart.getSource());
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryScenarioTest method testTriggerStageEntryCriterion.
@Test
@ScenarioUnderTest("triggerStageEntryCriterion.1")
public void testTriggerStageEntryCriterion() {
// given
String secondHumanTaskId = rule.caseExecutionQuery().activityId("PI_HumanTask_2").singleResult().getId();
String firstStageId = rule.caseExecutionQuery().activityId("PI_Stage_1").singleResult().getId();
// when
// complete human task
caseService.completeCaseExecution(secondHumanTaskId);
// then
// "PI_Stage_1" should be completed
CaseExecution firstStage = rule.caseExecutionQuery().activityId("PI_Stage_1").singleResult();
assertNull(firstStage);
// "PI_Stage_2" should be enabled
CaseExecution secondStage = rule.caseExecutionQuery().activityId("PI_Stage_2").singleResult();
assertNotNull(secondStage);
assertTrue(secondStage.isEnabled());
CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().sourceCaseExecutionId(firstStageId).singleResult();
// the associated sentry part is not satisfied
assertFalse(sentryPart.isSatisfied());
// the source is null (since this sentry part
// has been migrated into 7.4)
assertNull(sentryPart.getSource());
}
Aggregations