  @Test
  public void shouldDispatchEventFailAndIgnore() throws Exception {


    whenEventHandlerDispatchReturning(CompletableFutureUtil.failedFuture(exception), CompletableFuture.completedFuture(null));

    EventDeliveryExceptionHandlerWithState eventDeliveryExceptionHandlerWithState = mock(EventDeliveryExceptionHandlerWithState.class);

    when(exceptionHandlerManager.getEventHandler(exception)).thenReturn(eventDeliveryExceptionHandlerWithState);

    CompletableFuture<?> result = eventDispatcher.dispatch(de); // won't complete the future

    ArgumentCaptor<Runnable> ignoreArg = ArgumentCaptor.forClass(Runnable.class);

    verify(eventDeliveryExceptionHandlerWithState).handle(eq(exception), any(Runnable.class), any(Consumer.class), ignoreArg.capture());
    verify(exceptionHandlerManager).getEventHandler(exception);

    ignoreArg.getValue().run();

    result.get(1, TimeUnit.SECONDS);

    verify(eventHandler).dispatch(de);

  }