martinweiler commented on code in PR #4334:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4334#discussion_r3624033144
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java:
##########
@@ -186,11 +189,16 @@ public void testEscalationBoundaryEvent() {
@Test
public void testEscalationBoundaryEventInterrupting() throws Exception {
- kruntime =
createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2");
+ Application app = ProcessTestHelper.newApplication();
TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask",
handler);
- KogitoProcessInstance processInstance =
kruntime.startProcess("EscalationBoundaryEventInterrupting");
- assertProcessInstanceCompleted(processInstance);
+ ProcessTestHelper.registerHandler(app, "MyTask", handler);
+
org.kie.kogito.process.Process<EscalationBoundaryEventInterruptingModel>
processDefinition = EscalationBoundaryEventInterruptingProcess.newProcess(app);
+
org.kie.kogito.process.ProcessInstance<EscalationBoundaryEventInterruptingModel>
processInstance =
processDefinition.createInstance(processDefinition.createModel());
+ processInstance.start();
+ KogitoWorkItem workItem = handler.getWorkItem();
+ assertThat(workItem).isNotNull();
+ ProcessTestHelper.completeWorkItem(processInstance,
Collections.emptyMap(), "john");
Review Comment:
Why do we have to manually complete the work item here? If I look at this
process, then the expectation should be that the process gets completed through
the interrupting escalation event. That's also what the legacy test does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]