use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class SubprocessCompensationScenarioTest method testInitDeletion.
@Test
@ScenarioUnderTest("init.2")
public void testInitDeletion() {
// when compensation is thrown
Task beforeCompensationTask = rule.taskQuery().singleResult();
rule.getTaskService().complete(beforeCompensationTask.getId());
// then the process instance can be deleted
rule.getRuntimeService().deleteProcessInstance(rule.processInstance().getId(), "");
// and the process is ended
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class SubprocessCompensationScenarioTest method testInitActivityInstanceTree.
@Test
@ScenarioUnderTest("init.3")
public void testInitActivityInstanceTree() {
// given
ProcessInstance instance = rule.processInstance();
// when compensation is thrown
Task beforeCompensationTask = rule.taskQuery().singleResult();
rule.getTaskService().complete(beforeCompensationTask.getId());
// then the activity instance tree is meaningful
ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
Assert.assertNotNull(activityInstance);
assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("throwCompensate").beginScope("subProcess").activity("undoTask").done());
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class SubprocessCompensationScenarioTest method testInitConcurrentTriggerCompensationCompletion.
@Test
@ScenarioUnderTest("init.concurrent.triggerCompensation.1")
public void testInitConcurrentTriggerCompensationCompletion() {
// given active compensation
Task undoTask1 = rule.taskQuery().taskDefinitionKey("undoTask1").singleResult();
Task undoTask2 = rule.taskQuery().taskDefinitionKey("undoTask2").singleResult();
// then it is possible to complete compensation and the follow-up task
rule.getTaskService().complete(undoTask1.getId());
rule.getTaskService().complete(undoTask2.getId());
Task afterCompensateTask = rule.taskQuery().singleResult();
Assert.assertNotNull(afterCompensateTask);
Assert.assertEquals("afterCompensate", afterCompensateTask.getTaskDefinitionKey());
rule.getTaskService().complete(afterCompensateTask.getId());
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class SubprocessParallelThrowCompensationScenarioTest method testInitActivityInstanceTree.
@Test
@ScenarioUnderTest("init.3")
public void testInitActivityInstanceTree() {
// given
ProcessInstance instance = rule.processInstance();
// when compensation is thrown
Task beforeCompensationTask = rule.taskQuery().taskDefinitionKey("beforeCompensate").singleResult();
rule.getTaskService().complete(beforeCompensationTask.getId());
// then the activity instance tree is meaningful
ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
Assert.assertNotNull(activityInstance);
assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("concurrentTask").activity("throwCompensate").beginScope("subProcess").activity("undoTask").done());
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class SubprocessParallelThrowCompensationScenarioTest method testInitTriggerCompensationActivityInstanceTree.
@Test
@ScenarioUnderTest("init.triggerCompensation.3")
public void testInitTriggerCompensationActivityInstanceTree() {
// given active compensation
ProcessInstance instance = rule.processInstance();
// then the activity instance tree is meaningful
ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
Assert.assertNotNull(activityInstance);
assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("concurrentTask").beginScope("throwCompensate").activity("undoTask").done());
}
Aggregations