@Test public void shouldCallRegisteredListenersWhenConvertedEventIsNotEmpty() { ActivitiEntityEvent internalEvent = mock(ActivitiEntityEvent.class); BPMNTimerScheduledEventImpl convertedEvent = new BPMNTimerScheduledEventImpl(); given(converter.from(internalEvent)).willReturn(Optional.of(convertedEvent)); listenerDelegate.onEvent(internalEvent); verify(listener).onEvent(convertedEvent); }
@Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
TimerScheduledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } }
TimerScheduledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerScheduledListenerDelegate(List<BPMNElementEventListener<BPMNTimerScheduledEvent>> processRuntimeEventListeners,
                                          ToTimerScheduledConverter converter); }
TimerScheduledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerScheduledListenerDelegate(List<BPMNElementEventListener<BPMNTimerScheduledEvent>> processRuntimeEventListeners,
                                          ToTimerScheduledConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException(); }
TimerScheduledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerScheduledListenerDelegate(List<BPMNElementEventListener<BPMNTimerScheduledEvent>> processRuntimeEventListeners,
                                          ToTimerScheduledConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException();  }