From d4280e63709bc9349d63bc03fbcae09fbeedf2d1 Mon Sep 17 00:00:00 2001 From: Roman Saratz Date: Wed, 24 Jan 2024 08:30:41 +0100 Subject: [PATCH] Added test for correlation parameters on start event --- ...ocessStartEventRegistryDeploymentTest.java | 24 +++++++ ...ProcessWithCorrelationParameter.bpmn20.xml | 67 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 modules/flowable-engine/src/test/resources/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.java index ce566a8ec49..8f64347bbe2 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.java @@ -73,6 +73,30 @@ public void testStaticEventRegistryProcessStart() { assertThat(runtimeService.createProcessInstanceQuery().list()).isEmpty(); } + @Test + @Deployment(resources = { + "org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml", + "org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.sendTestEventProcess.bpmn20.xml", + "org/flowable/engine/test/eventregistry/SendInternalEventTaskTest.simple.event" + }) + public void testStaticEventRegistryProcessWithCorrelationParameter() { + sendEvent("gonzo", "start"); + assertThat(runtimeService.createProcessInstanceQuery().count()).isZero(); + + sendEvent("kermit", "start"); + assertThat(runtimeService.createProcessInstanceQuery().list()) + .extracting(ProcessInstance::getProcessDefinitionKey) + .containsExactlyInAnyOrder("eventRegistryDynamicStartTestProcessWithCorrelationParameter"); + + Task task = taskService.createTaskQuery().singleResult(); + assertThat(task).isNotNull(); + + taskService.complete(task.getId()); + + assertThat(runtimeService.createProcessInstanceQuery().list()).isEmpty(); + + } + @Test @Deployment(resources = { "org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testDynamicEventRegistryProcessStart.bpmn20.xml", diff --git a/modules/flowable-engine/src/test/resources/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml b/modules/flowable-engine/src/test/resources/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml new file mode 100644 index 00000000000..96737ae4d04 --- /dev/null +++ b/modules/flowable-engine/src/test/resources/org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file