class SagaExecutionTask implements ExecutedRunnable {

    @Override
    public void run() {
        try {
            handle();
        } catch (Exception e) {
            Throwables.throwIfUnchecked(e);
            throw new RuntimeException(e);
        }
    }

}

class SagaExecutionTaskTest {

    private SagaExecutionTask sut;
    private TimeoutManager timeoutManager;
    private StateStorage storage;
    private Saga saga;
    private SagaInstanceInfo sagaInstanceInfo;
    private SagaState state;
    private CurrentExecutionContext context;
    private Object theMessage;
    private HandlerInvoker invoker;
    private InstanceResolver instanceResolver;
    private SagaModule module;
    private SagaLifetimeInterceptor interceptor;
    @Rule
    public ExpectedException thrown;

    @Test
    public void run_invokeThrows_moduleErrorGetsCalled() throws InvocationTargetException, IllegalAccessException {

        // given
        NullPointerException npe = new NullPointerException();
        doThrow(npe).when(invoker).invoke(isA(InvocationContext.class));

        try {
            // when
            sut.run();
        } catch (NullPointerException ex) {
            // got you
        }

        // then
        verify(module).onError(context, theMessage, npe);
    }

}