@Test void shouldNotifyExceptionHandlerWhenIllegalAccessExceptionOccurs() throws Exception { final ClassWithPrivateMethod target = new ClassWithPrivateMethod(); final Method method = ClassWithPrivateMethod.class.getDeclaredMethod("run"); final DirectEventDeliverer<ClassWithPrivateMethod> deliverer = new DirectEventDeliverer<>(exceptionHandler, new NoOpMetricsSystem()); deliverer.deliverTo(target, method, NO_ARGS); verify(exceptionHandler) .handleException(any(IllegalAccessException.class), eq(target), eq(method), eq(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);   }