diff --git a/engine/src/test/java/io/camunda/zeebe/engine/processing/bpmn/subprocess/EmbeddedSubProcessTest.java b/engine/src/test/java/io/camunda/zeebe/engine/processing/bpmn/subprocess/EmbeddedSubProcessTest.java index 42f375d4ef7a..b23a08647ed1 100644 --- a/engine/src/test/java/io/camunda/zeebe/engine/processing/bpmn/subprocess/EmbeddedSubProcessTest.java +++ b/engine/src/test/java/io/camunda/zeebe/engine/processing/bpmn/subprocess/EmbeddedSubProcessTest.java @@ -24,6 +24,7 @@ import io.camunda.zeebe.protocol.record.ValueType; import io.camunda.zeebe.protocol.record.intent.JobIntent; import io.camunda.zeebe.protocol.record.intent.MessageIntent; +import io.camunda.zeebe.protocol.record.intent.MessageSubscriptionIntent; import io.camunda.zeebe.protocol.record.intent.ProcessEventIntent; import io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent; import io.camunda.zeebe.protocol.record.intent.VariableIntent; @@ -623,10 +624,15 @@ public void shouldNotTriggerBoundaryEventWhenFlowscopeIsInterrupted() { .withVariable("correlationKey", "correlationKey") .create(); - RecordingExporter.processInstanceRecords(ProcessInstanceIntent.ELEMENT_ACTIVATED) - .withProcessInstanceKey(processInstanceKey) - .withElementId("task") - .await(); + assertThat( + RecordingExporter.messageSubscriptionRecords(MessageSubscriptionIntent.CREATED) + .withProcessInstanceKey(processInstanceKey) + .limit(2)) + .describedAs( + "The 2 message subscriptions must be created before we publish the " + + "messages. As the messages have a TTL of 0 seconds") + .describedAs("") + .hasSize(2); // when // We need to make sure no records are written in between the publish commands. This could