@DataProvider(value = { "true", "false" }) @Test public void current_thread_info_constructor_sets_fields_as_expected(boolean useStaticFactory) { Tracer.getInstance().startRequestWithRootSpan("request-" + UUID.randomUUID().toString()); Deque<Span> spanStackMock = Tracer.getInstance().getCurrentSpanStackCopy(); Map<String, String> mdcInfoMock = MDC.getCopyOfContextMap(); CallableWithTracing instance = (useStaticFactory) ? withTracing(callableMock) : new CallableWithTracing(callableMock); assertThat(instance.origCallable).isSameAs(callableMock); assertThat(instance.spanStackForExecution).isEqualTo(spanStackMock); assertThat(instance.mdcContextMapForExecution).isEqualTo(mdcInfoMock); }
public static <U> CallableWithTracing<U> withTracing(Callable<U> origCallable) { return new CallableWithTracing<>(origCallable); }
CallableWithTracing implements Callable<U> { public static <U> CallableWithTracing<U> withTracing(Callable<U> origCallable) { return new CallableWithTracing<>(origCallable); } }
CallableWithTracing implements Callable<U> { public static <U> CallableWithTracing<U> withTracing(Callable<U> origCallable) { return new CallableWithTracing<>(origCallable); } CallableWithTracing(Callable<U> origCallable);  CallableWithTracing(Callable<U> origCallable,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  CallableWithTracing(Callable<U> origCallable,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); }
CallableWithTracing implements Callable<U> { public static <U> CallableWithTracing<U> withTracing(Callable<U> origCallable) { return new CallableWithTracing<>(origCallable); } CallableWithTracing(Callable<U> origCallable);  CallableWithTracing(Callable<U> origCallable,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  CallableWithTracing(Callable<U> origCallable,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); static CallableWithTracing<U> withTracing(Callable<U> origCallable); static CallableWithTracing<U> withTracing(Callable<U> origCallable,
                                                         Pair<Deque<Span>, Map<String, String>> originalThreadInfo); static CallableWithTracing<U> withTracing(Callable<U> origCallable,
                                                         Deque<Span> spanStackForExecution,
                                                         Map<String, String> mdcContextMapForExecution); @Override @SuppressWarnings("deprecation") U call(); }
CallableWithTracing implements Callable<U> { public static <U> CallableWithTracing<U> withTracing(Callable<U> origCallable) { return new CallableWithTracing<>(origCallable); } CallableWithTracing(Callable<U> origCallable);  CallableWithTracing(Callable<U> origCallable,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  CallableWithTracing(Callable<U> origCallable,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); static CallableWithTracing<U> withTracing(Callable<U> origCallable); static CallableWithTracing<U> withTracing(Callable<U> origCallable,
                                                         Pair<Deque<Span>, Map<String, String>> originalThreadInfo); static CallableWithTracing<U> withTracing(Callable<U> origCallable,
                                                         Deque<Span> spanStackForExecution,
                                                         Map<String, String> mdcContextMapForExecution); @Override @SuppressWarnings("deprecation") U call();  }