@Test void testHandleThrowsExceptionIfDelegatesThrowAnException() throws Exception { doThrow(new RuntimeException()).when(mockedEventHandlerInvokerTwo).handle(testEventMessage, testSegment); assertThrows(RuntimeException.class, () -> testSubject.handle(testEventMessage, testSegment)); }
@Override public void handle(EventMessage<?> message, Segment segment) throws Exception { for (EventHandlerInvoker i : delegates) { if (canHandle(i, message, segment)) { i.handle(message, segment); } } }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public void handle(EventMessage<?> message, Segment segment) throws Exception { for (EventHandlerInvoker i : delegates) { if (canHandle(i, message, segment)) { i.handle(message, segment); } } } }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public void handle(EventMessage<?> message, Segment segment) throws Exception { for (EventHandlerInvoker i : delegates) { if (canHandle(i, message, segment)) { i.handle(message, segment); } } } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public void handle(EventMessage<?> message, Segment segment) throws Exception { for (EventHandlerInvoker i : delegates) { if (canHandle(i, message, segment)) { i.handle(message, segment); } } } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); List<EventHandlerInvoker> delegates(); @Override boolean canHandle(EventMessage<?> eventMessage, Segment segment); @Override boolean canHandleType(Class<?> payloadType); @Override void handle(EventMessage<?> message, Segment segment); @Override boolean supportsReset(); @Override void performReset(); @Override void performReset(R resetContext); }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public void handle(EventMessage<?> message, Segment segment) throws Exception { for (EventHandlerInvoker i : delegates) { if (canHandle(i, message, segment)) { i.handle(message, segment); } } } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); List<EventHandlerInvoker> delegates(); @Override boolean canHandle(EventMessage<?> eventMessage, Segment segment); @Override boolean canHandleType(Class<?> payloadType); @Override void handle(EventMessage<?> message, Segment segment); @Override boolean supportsReset(); @Override void performReset(); @Override void performReset(R resetContext);  }