@Test public void shouldRetryAfterTimeout() { EventDeliveryExceptionHandlerWithState rh = manager.getEventHandler(throwable); rh.handle(throwable, redo, fail, ignore); verify(scheduler).setTimer(eq(retryIntervalMillis), any()); verify(redo).run(); verifyNoMoreInteractions(fail); }
@Override public EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t) { EventDeliveryExceptionHandler eh = exceptionHandlers.stream() .filter(eh1 -> eh1.handles(t)) .findFirst() .orElseGet(FailEventDeliveryExceptionHandler::new); return new EventDeliveryExceptionHandlerWithState(eh, eh.makeState(t)); }
EventDeliveryExceptionHandlerManagerImpl implements EventDeliveryExceptionHandlerManager { @Override public EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t) { EventDeliveryExceptionHandler eh = exceptionHandlers.stream() .filter(eh1 -> eh1.handles(t)) .findFirst() .orElseGet(FailEventDeliveryExceptionHandler::new); return new EventDeliveryExceptionHandlerWithState(eh, eh.makeState(t)); } }
EventDeliveryExceptionHandlerManagerImpl implements EventDeliveryExceptionHandlerManager { @Override public EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t) { EventDeliveryExceptionHandler eh = exceptionHandlers.stream() .filter(eh1 -> eh1.handles(t)) .findFirst() .orElseGet(FailEventDeliveryExceptionHandler::new); return new EventDeliveryExceptionHandlerWithState(eh, eh.makeState(t)); } EventDeliveryExceptionHandlerManagerImpl(List<EventDeliveryExceptionHandler> exceptionHandlers); }
EventDeliveryExceptionHandlerManagerImpl implements EventDeliveryExceptionHandlerManager { @Override public EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t) { EventDeliveryExceptionHandler eh = exceptionHandlers.stream() .filter(eh1 -> eh1.handles(t)) .findFirst() .orElseGet(FailEventDeliveryExceptionHandler::new); return new EventDeliveryExceptionHandlerWithState(eh, eh.makeState(t)); } EventDeliveryExceptionHandlerManagerImpl(List<EventDeliveryExceptionHandler> exceptionHandlers); @Override EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t); }
EventDeliveryExceptionHandlerManagerImpl implements EventDeliveryExceptionHandlerManager { @Override public EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t) { EventDeliveryExceptionHandler eh = exceptionHandlers.stream() .filter(eh1 -> eh1.handles(t)) .findFirst() .orElseGet(FailEventDeliveryExceptionHandler::new); return new EventDeliveryExceptionHandlerWithState(eh, eh.makeState(t)); } EventDeliveryExceptionHandlerManagerImpl(List<EventDeliveryExceptionHandler> exceptionHandlers); @Override EventDeliveryExceptionHandlerWithState getEventHandler(Throwable t);  }