@Test public void shouldDoNothingWhenConvertedEventIsEmpty() { ActivitiEntityEvent internalEvent = mock(ActivitiEntityEvent.class); given(converter.from(internalEvent)).willReturn(Optional.empty()); listenerDelegate.onEvent(internalEvent); verify(listener, never()).onEvent(any()); }
@Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerExecutedEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
TimerExecutedListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerExecutedEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } }
TimerExecutedListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerExecutedEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerExecutedListenerDelegate(List<BPMNElementEventListener<BPMNTimerExecutedEvent>> processRuntimeEventListeners,
                                         ToTimerExecutedConverter converter); }
TimerExecutedListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerExecutedEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerExecutedListenerDelegate(List<BPMNElementEventListener<BPMNTimerExecutedEvent>> processRuntimeEventListeners,
                                         ToTimerExecutedConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException(); }
TimerExecutedListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerExecutedEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerExecutedListenerDelegate(List<BPMNElementEventListener<BPMNTimerExecutedEvent>> processRuntimeEventListeners,
                                         ToTimerExecutedConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException();  }