@Test void shouldNotifyExceptionHandlerWhenMethodThrowsException() throws Exception { final RuntimeException error = new RuntimeException("Nope"); doThrow(error).when(target).run(); final Method method = Runnable.class.getMethod("run"); deliverer.deliverTo(target, method, NO_ARGS); verify(target).run(); verify(exceptionHandler).handleException(error, target, method, NO_ARGS); verifyNoMoreInteractions(exceptionHandler); }
@Override protected void deliverTo(final T subscriber, final Method method, final Object[] args) { final SafeFuture<Object> result = executeMethod(subscriber, method, args); if (result != null) { result.finish( () -> {}, error -> exceptionHandler.handleException(error, subscriber, method, args)); } }
DirectEventDeliverer extends EventDeliverer<T> { @Override protected void deliverTo(final T subscriber, final Method method, final Object[] args) { final SafeFuture<Object> result = executeMethod(subscriber, method, args); if (result != null) { result.finish( () -> {}, error -> exceptionHandler.handleException(error, subscriber, method, args)); } } }
DirectEventDeliverer extends EventDeliverer<T> { @Override protected void deliverTo(final T subscriber, final Method method, final Object[] args) { final SafeFuture<Object> result = executeMethod(subscriber, method, args); if (result != null) { result.finish( () -> {}, error -> exceptionHandler.handleException(error, subscriber, method, args)); } } DirectEventDeliverer(
      final ChannelExceptionHandler exceptionHandler, final MetricsSystem metricsSystem); }
DirectEventDeliverer extends EventDeliverer<T> { @Override protected void deliverTo(final T subscriber, final Method method, final Object[] args) { final SafeFuture<Object> result = executeMethod(subscriber, method, args); if (result != null) { result.finish( () -> {}, error -> exceptionHandler.handleException(error, subscriber, method, args)); } } DirectEventDeliverer(
      final ChannelExceptionHandler exceptionHandler, final MetricsSystem metricsSystem);  }
DirectEventDeliverer extends EventDeliverer<T> { @Override protected void deliverTo(final T subscriber, final Method method, final Object[] args) { final SafeFuture<Object> result = executeMethod(subscriber, method, args); if (result != null) { result.finish( () -> {}, error -> exceptionHandler.handleException(error, subscriber, method, args)); } } DirectEventDeliverer(
      final ChannelExceptionHandler exceptionHandler, final MetricsSystem metricsSystem);   }