@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<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
TimerCancelledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } }
TimerCancelledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerCancelledListenerDelegate(List<BPMNElementEventListener<BPMNTimerCancelledEvent>> processRuntimeEventListeners,
                                          ToTimerCancelledConverter converter); }
TimerCancelledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerCancelledListenerDelegate(List<BPMNElementEventListener<BPMNTimerCancelledEvent>> processRuntimeEventListeners,
                                          ToTimerCancelledConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException(); }
TimerCancelledListenerDelegate implements ActivitiEventListener { @Override public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerCancelledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } TimerCancelledListenerDelegate(List<BPMNElementEventListener<BPMNTimerCancelledEvent>> processRuntimeEventListeners,
                                          ToTimerCancelledConverter converter); @Override void onEvent(ActivitiEvent event); @Override boolean isFailOnException();  }