Source:
<code>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, <START> BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, <END> 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(); }</code><technical_language>@CTI777 this test more clear if split operations assertions in half.. 1) Start assertions 1.1) check event is BPMN element is catch signal. collectedEvents.clear(); 2) Signal assertions</technical_language>

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"); }