@Test public void testRunnableTraceTokenCopied() throws InterruptedException { AtomicReference<TraceToken> actualToken = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1); ExecutorService innerExecutor = newSingleThreadExecutor(); try { createAndRegisterNewRequestToken("somekey", "somevalue"); TraceToken token = getCurrentTraceToken(); traceTokenCopyingExecutor(innerExecutor).execute(() -> { actualToken.set(getCurrentTraceToken()); latch.countDown(); }); assertTrue(latch.await(10, SECONDS)); assertEquals(actualToken.get(), token); } finally { innerExecutor.shutdown(); } }
private TraceTokenCopyingExecutor(ExecutorService executor) { super(executor); }
TraceTokenCopyingExecutor extends WrappingExecutorService { private TraceTokenCopyingExecutor(ExecutorService executor) { super(executor); } }
TraceTokenCopyingExecutor extends WrappingExecutorService { private TraceTokenCopyingExecutor(ExecutorService executor) { super(executor); } private  TraceTokenCopyingExecutor(ExecutorService executor); }
TraceTokenCopyingExecutor extends WrappingExecutorService { private TraceTokenCopyingExecutor(ExecutorService executor) { super(executor); } private  TraceTokenCopyingExecutor(ExecutorService executor); static ExecutorService traceTokenCopyingExecutor(ExecutorService executor); }
TraceTokenCopyingExecutor extends WrappingExecutorService { private TraceTokenCopyingExecutor(ExecutorService executor) { super(executor); } private  TraceTokenCopyingExecutor(ExecutorService executor); static ExecutorService traceTokenCopyingExecutor(ExecutorService executor);  }