@Test public void run_invokerAndModuleFinishThrow_throwsSagaExecutionExceptions() throws InvocationTargetException, IllegalAccessException { doThrow(ArithmeticException.class).when(invoker).invoke(isA(InvocationContext.class)); doThrow(NullPointerException.class).when(module).onFinished(any(ExecutionContext.class)); catchException(() -> sut.run()); SagaExecutionErrorsException exception = caughtException(); assertThat("Expected two exceptions in resulting one.", exception.getExecutionErrors(), hasSize(2)); assertThat("Expected two exceptions in resulting one.", exception.getExecutionErrors(), hasItem(instanceOf(NullPointerException.class))); assertThat("Expected two exceptions in resulting one.", exception.getExecutionErrors(), hasItem(instanceOf(ArithmeticException.class))); }
@Override public void run() { try { handle(); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } }
SagaExecutionTask implements ExecutedRunnable { @Override public void run() { try { handle(); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } } }
SagaExecutionTask implements ExecutedRunnable { @Override public void run() { try { handle(); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } } @Inject  SagaExecutionTask(
            final SagaEnvironment environment,
            final HandlerInvoker invoker,
            final Object message,
            final Map<HeaderName<?>, Object> headers,
            @Nullable final ExecutionContext parentContext); }
SagaExecutionTask implements ExecutedRunnable { @Override public void run() { try { handle(); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } } @Inject  SagaExecutionTask(
            final SagaEnvironment environment,
            final HandlerInvoker invoker,
            final Object message,
            final Map<HeaderName<?>, Object> headers,
            @Nullable final ExecutionContext parentContext); void handle(); @Override void run(); @Override Object message(); @Override Optional<T> getHeaderValue(final HeaderName<T> header); }
SagaExecutionTask implements ExecutedRunnable { @Override public void run() { try { handle(); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } } @Inject  SagaExecutionTask(
            final SagaEnvironment environment,
            final HandlerInvoker invoker,
            final Object message,
            final Map<HeaderName<?>, Object> headers,
            @Nullable final ExecutionContext parentContext); void handle(); @Override void run(); @Override Object message(); @Override Optional<T> getHeaderValue(final HeaderName<T> header);  }