Source:
public void testProcessWithIntermediateCatchEventSignal() { securityUtil.logInAs("user1"); String processInstanceId = startIntermediateCatchEventSignalProcess(); SignalPayload signalPayload = ProcessPayloadBuilder.signal() .withName("Test") .withVariable("signal-variable", "test") .build(); processRuntime.signal(signalPayload); assertThat(collectedEvents) .extracting(RuntimeEvent::getEventType) .containsExactly( ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED ); BPMNSignalReceivedEvent event = (BPMNSignalReceivedEvent) collectedEvents.get(6); assertThat(event.getEntity()).isNotNull(); assertThat(event.getProcessInstanceId()).isEqualTo(processInstanceId); assertThat(event.getEntity().getSignalPayload()).isNotNull(); assertThat(event.getEntity().getSignalPayload().getName()).isEqualTo(signalPayload.getName()); assertThat(event.getEntity().getSignalPayload().getVariables().size()).isEqualTo(signalPayload.getVariables().size()); assertThat(event.getEntity().getSignalPayload().getVariables().get("signal-variable")).isEqualTo("test"); collectedEvents.clear(); }

Target:
public void testProcessWithIntermediateCatchEventSignal() { securityUtil.logInAs("user1"); ProcessInstance processInstance = startIntermediateCatchEventSignalProcess(); assertThat(collectedEvents) .extracting(RuntimeEvent::getEventType) .containsExactly( ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED ); BPMNActivityImpl signalCatchEvent = (BPMNActivityImpl)collectedEvents.get(5).getEntity(); assertThat(signalCatchEvent.getActivityType()).isEqualTo("intermediateCatchEvent"); collectedEvents.clear(); SignalPayload signalPayload = ProcessPayloadBuilder.signal() .withName("Test") .withVariable("signal-variable", "test") .build(); processRuntime.signal(signalPayload); assertThat(collectedEvents) .extracting(RuntimeEvent::getEventType) .containsExactly( BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED ); BPMNSignalReceivedEvent event = (BPMNSignalReceivedEvent) collectedEvents.get(0); assertThat(event.getEntity()).isNotNull(); assertThat(event.getProcessInstanceId()).isEqualTo(processInstance.getId()); assertThat(event.getEntity().getSignalPayload()).isNotNull(); assertThat(event.getEntity().getSignalPayload().getName()).isEqualTo(signalPayload.getName()); assertThat(event.getEntity().getSignalPayload().getVariables().size()).isEqualTo(signalPayload.getVariables().size()); assertThat(event.getEntity().getSignalPayload().getVariables().get("signal-variable")).isEqualTo("test"); }