AsyncNotificationStrategy implements NotificationStrategy { @Override @SuppressWarnings("rawtypes") public void notifyListener(final EventListener listener, final AbstractNotificationEvent event) { if (listener != null) { THREAD_LOCAL.get().execute(new NotifyRunnable(listener, event)); } }  @Override @SuppressWarnings("rawtypes") void notifyListener(final EventListener listener, final AbstractNotificationEvent event);  }
@Test @SuppressWarnings("rawtypes") public void testNotifyEvent() throws InterruptedException { EventListener listener = mock(EventListener.class); victim.notifyListener(listener, new TaskExecutionCompletedEvent(1L, NotifiableTaskMetadata.NULL)); Thread.sleep(1000); verify(listener, times(1)).onEvent(any(AbstractNotificationEvent.class)); }