martinweiler commented on code in PR #3610:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3610#discussion_r1711689828
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java:
##########
@@ -287,180 +338,179 @@ public void
testSignalBoundaryEventOnTaskWithSignalName() throws Exception {
}
@Test
- public void testSignalBoundaryEventOnTaskComplete() throws Exception {
- kruntime =
createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn");
-
+ public void testSignalBoundaryEventOnTaskComplete() {
+ Application app = ProcessTestHelper.newApplication();
TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human
Task", handler);
-
kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER);
- KogitoProcessInstance processInstance =
kruntime.startProcess("BoundarySignalEventOnTask");
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(),
null);
- kruntime.signalEvent("MySignal", "value");
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(),
null);
- assertProcessInstanceFinished(processInstance, kruntime);
-
+ ProcessTestHelper.registerHandler(app, "Human Task", handler);
+ ProcessTestHelper.registerProcessEventListener(app,
LOGGING_EVENT_LISTENER);
+ org.kie.kogito.process.Process<BoundarySignalEventOnTaskModel>
processDefinition = BoundarySignalEventOnTaskProcess.newProcess(app);
+ BoundarySignalEventOnTaskModel model = processDefinition.createModel();
+ org.kie.kogito.process.ProcessInstance<BoundarySignalEventOnTaskModel>
instance = processDefinition.createInstance(model);
+ instance.start();
+ KogitoWorkItem workItem = handler.getWorkItem();
+ instance.completeWorkItem(workItem.getStringId(), null);
+ instance.send(Sig.of("MySignal", "value"));
Review Comment:
It is unclear to me what this test is trying to verify. If both work items
are completed, the signal is superfluous. Vice versa, the test would also pass
just by sending the signal, without completing the work items.
--
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]