@Test public void timeoutTriggered_headerValue_headerValuePartOfCallback() { TimeoutExpirationCallback expiredCallback = mock(TimeoutExpirationCallback.class); sut.addExpiredCallback(expiredCallback); requestAndTriggerTimeout(); ArgumentCaptor<TimeoutExpirationContext> captor = ArgumentCaptor.forClass(TimeoutExpirationContext.class); verify(expiredCallback).expired(isA(Timeout.class), captor.capture()); Map<HeaderName<?>, Object> headers = captor.getValue().getOriginalHeaders(); assertThat("Expected header value in callback param.", headers.get(DEFAULT_HEADER), equalTo(DEFAULT_HEADER_VALUE)); }
@Override public void addExpiredCallback(final TimeoutExpired callback) { checkNotNull(callback, "Expired callback not allowed to be null."); callbacks.add(callback); }
InMemoryTimeoutManager implements TimeoutManager, AutoCloseable { @Override public void addExpiredCallback(final TimeoutExpired callback) { checkNotNull(callback, "Expired callback not allowed to be null."); callbacks.add(callback); } }
InMemoryTimeoutManager implements TimeoutManager, AutoCloseable { @Override public void addExpiredCallback(final TimeoutExpired callback) { checkNotNull(callback, "Expired callback not allowed to be null."); callbacks.add(callback); } InMemoryTimeoutManager();  InMemoryTimeoutManager(final int timerThreadPoolSize);  InMemoryTimeoutManager(final ScheduledExecutorService scheduledService, final Clock clock); }
InMemoryTimeoutManager implements TimeoutManager, AutoCloseable { @Override public void addExpiredCallback(final TimeoutExpired callback) { checkNotNull(callback, "Expired callback not allowed to be null."); callbacks.add(callback); } InMemoryTimeoutManager();  InMemoryTimeoutManager(final int timerThreadPoolSize);  InMemoryTimeoutManager(final ScheduledExecutorService scheduledService, final Clock clock); @Override void addExpiredCallback(final TimeoutExpired callback); @Override TimeoutId requestTimeout(final ExecutionContext context, final String sagaId, final long delay, final TimeUnit timeUnit, @Nullable final String name,
                               @Nullable final Object data); @Override void cancelTimeouts(final String sagaId); @Override void cancelTimeout(final TimeoutId id); @Override void close(); }
InMemoryTimeoutManager implements TimeoutManager, AutoCloseable { @Override public void addExpiredCallback(final TimeoutExpired callback) { checkNotNull(callback, "Expired callback not allowed to be null."); callbacks.add(callback); } InMemoryTimeoutManager();  InMemoryTimeoutManager(final int timerThreadPoolSize);  InMemoryTimeoutManager(final ScheduledExecutorService scheduledService, final Clock clock); @Override void addExpiredCallback(final TimeoutExpired callback); @Override TimeoutId requestTimeout(final ExecutionContext context, final String sagaId, final long delay, final TimeUnit timeUnit, @Nullable final String name,
                               @Nullable final Object data); @Override void cancelTimeouts(final String sagaId); @Override void cancelTimeout(final TimeoutId id); @Override void close();  }