@Test public void run_parentContextProvided_contextHasParentContext() { CurrentExecutionContext context = new SagaExecutionContext(); ExecutionContext parentContext = mock(ExecutionContext.class); SagaEnvironment env = SagaEnvironment.create(timeoutManager, storage, createContextProvider(context), Sets.newHashSet(module), Sets.newHashSet(interceptor), instanceResolver, DefaultModuleCoordinator::new); sut = new SagaExecutionTask(env, invoker, theMessage, Collections.EMPTY_MAP, parentContext); sut.run(); assertThat("Expected header value to be part of context.", context.parentContext(), sameInstance(parentContext)); }
@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);  }