use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitThrowError.
@Test
@ScenarioUnderTest("init.5")
public void testInitThrowError() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.ERROR_INDICATOR_VARIABLE, true);
rule.getTaskService().complete(eventSubprocessTask.getId());
// then
Task escalatedTask = rule.taskQuery().singleResult();
Assert.assertEquals("escalatedTask", escalatedTask.getTaskDefinitionKey());
Assert.assertNotNull(escalatedTask);
rule.getTaskService().complete(escalatedTask.getId());
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitTask1ThrowUnhandledException.
@Test
@ScenarioUnderTest("init.innerTask.5")
public void testInitTask1ThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().singleResult();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.getTaskService().complete(eventSubprocessTask.getId());
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitDeletion.
@Test
@ScenarioUnderTest("init.4")
public void testInitDeletion() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().deleteProcessInstance(instance.getId(), null);
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitTask1ActivityInstanceTree.
@Test
@ScenarioUnderTest("init.innerTask.2")
public void testInitTask1ActivityInstanceTree() {
// given
ProcessInstance instance = rule.processInstance();
// when
ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
// then
Assert.assertNotNull(activityInstance);
assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).beginScope("subProcess").activity("eventSubProcessTask").done());
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitTask1Completion.
@Test
@ScenarioUnderTest("init.innerTask.1")
public void testInitTask1Completion() {
// given
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
// when
rule.getTaskService().complete(eventSubprocessTask.getId());
// then
rule.assertScenarioEnded();
}
Aggregations