use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitMessageCompletionCase1.
@Test
@ScenarioUnderTest("initMessage.1")
public void testInitMessageCompletionCase1() {
// given
Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
// when
rule.messageCorrelation("ReceiveTaskMessage").correlate();
rule.getTaskService().complete(afterBoundaryTask.getId());
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitMessageCompletionCase2.
@Test
@ScenarioUnderTest("initMessage.2")
public void testInitMessageCompletionCase2() {
// given
Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
// when
rule.getTaskService().complete(afterBoundaryTask.getId());
rule.messageCorrelation("ReceiveTaskMessage").correlate();
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitMessageTriggerBoundary.
@Test
@ScenarioUnderTest("initMessage.5")
public void testInitMessageTriggerBoundary() {
// when the boundary event is triggered another 2 times
for (int i = 0; i < 2; i++) {
rule.messageCorrelation("BoundaryEventMessage").correlate();
}
// and the tasks are completed
List<Task> afterBoundaryTasks = rule.taskQuery().list();
Assert.assertEquals(3, afterBoundaryTasks.size());
for (Task afterBoundaryTask : afterBoundaryTasks) {
rule.getTaskService().complete(afterBoundaryTask.getId());
}
rule.messageCorrelation("ReceiveTaskMessage").correlate();
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitTimerThrowError.
@Test
@ScenarioUnderTest("initTimer.6")
public void testInitTimerThrowError() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.ERROR_INDICATOR_VARIABLE, true);
rule.messageCorrelation("ReceiveTaskMessage").correlate();
// then
// there is only one task since the task after the message boundary event has been cancelled due to bug CAM-3727 in 7.2.0
Assert.assertEquals(1, rule.taskQuery().count());
Task afterErrorTask = rule.taskQuery().taskDefinitionKey("escalatedTask").singleResult();
Assert.assertNotNull(afterErrorTask);
// and
rule.getTaskService().complete(afterErrorTask.getId());
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitTimerThrowUnhandledException.
@Test
@ScenarioUnderTest("initTimer.7")
public void testInitTimerThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.messageCorrelation("ReceiveTaskMessage").correlate();
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
Aggregations