@DataProvider(value = { "true", "false" }, splitBy = "\\|") @Test public void unlinkTracingFromCurrentThread_pair_works_as_expected(boolean useNullPair) { Pair<Deque<Span>, Map<String, String>> infoForLinking = (useNullPair) ? null : generateTracingInfo(); resetTracing(); Tracer.getInstance().startRequestWithRootSpan("foo-" + UUID.randomUUID().toString()); unlinkTracingFromCurrentThread(infoForLinking); Pair<Deque<Span>, Map<String, String>> postCallInfo = Pair.of( Tracer.getInstance().getCurrentSpanStackCopy(), MDC.getCopyOfContextMap() ); if (useNullPair) { assertThat(postCallInfo.getLeft()).isNull(); assertThat(postCallInfo.getRight()).isNullOrEmpty(); } else assertThat(postCallInfo).isEqualTo(infoForLinking); }
@Deprecated public static void unlinkTracingFromCurrentThread( Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor ) { Deque<Span> spanStackToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getLeft(); Map<String, String> mdcContextMapToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getRight(); unlinkTracingFromCurrentThread(spanStackToResetFor, mdcContextMapToResetFor); }
AsyncWingtipsHelperJava7 { @Deprecated public static void unlinkTracingFromCurrentThread( Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor ) { Deque<Span> spanStackToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getLeft(); Map<String, String> mdcContextMapToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getRight(); unlinkTracingFromCurrentThread(spanStackToResetFor, mdcContextMapToResetFor); } }
AsyncWingtipsHelperJava7 { @Deprecated public static void unlinkTracingFromCurrentThread( Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor ) { Deque<Span> spanStackToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getLeft(); Map<String, String> mdcContextMapToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getRight(); unlinkTracingFromCurrentThread(spanStackToResetFor, mdcContextMapToResetFor); } protected  AsyncWingtipsHelperJava7(); }
AsyncWingtipsHelperJava7 { @Deprecated public static void unlinkTracingFromCurrentThread( Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor ) { Deque<Span> spanStackToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getLeft(); Map<String, String> mdcContextMapToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getRight(); unlinkTracingFromCurrentThread(spanStackToResetFor, mdcContextMapToResetFor); } protected  AsyncWingtipsHelperJava7(); @Deprecated static Runnable runnableWithTracing(Runnable runnable); @Deprecated static Runnable runnableWithTracing(Runnable runnable,
                                               Pair<Deque<Span>, Map<String, String>> threadInfoToLink); @Deprecated static Runnable runnableWithTracing(Runnable runnable,
                                               Deque<Span> spanStackToLink,
                                               Map<String, String> mdcContextMapToLink); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable,
                                                      Pair<Deque<Span>, Map<String, String>> threadInfoToLink); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable,
                                                      Deque<Span> spanStackToLink,
                                                      Map<String, String> mdcContextMapToLink); @Deprecated static ExecutorServiceWithTracing executorServiceWithTracing(ExecutorService delegate); @Deprecated static ScheduledExecutorServiceWithTracing scheduledExecutorServiceWithTracing(
        ScheduledExecutorService delegate
    ); @Deprecated static TracingState linkTracingToCurrentThread(
        Pair<Deque<Span>, Map<String, String>> threadInfoToLink
    ); @Deprecated static TracingState linkTracingToCurrentThread(
        Deque<Span> spanStackToLink,
        Map<String, String> mdcContextMapToLink
    ); @Deprecated static void unlinkTracingFromCurrentThread(
        Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor
    ); @Deprecated static void unlinkTracingFromCurrentThread(Deque<Span> spanStackToResetFor,
                                                      Map<String, String> mdcContextMapToResetFor); }
AsyncWingtipsHelperJava7 { @Deprecated public static void unlinkTracingFromCurrentThread( Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor ) { Deque<Span> spanStackToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getLeft(); Map<String, String> mdcContextMapToResetFor = (threadInfoToResetFor == null) ? null : threadInfoToResetFor.getRight(); unlinkTracingFromCurrentThread(spanStackToResetFor, mdcContextMapToResetFor); } protected  AsyncWingtipsHelperJava7(); @Deprecated static Runnable runnableWithTracing(Runnable runnable); @Deprecated static Runnable runnableWithTracing(Runnable runnable,
                                               Pair<Deque<Span>, Map<String, String>> threadInfoToLink); @Deprecated static Runnable runnableWithTracing(Runnable runnable,
                                               Deque<Span> spanStackToLink,
                                               Map<String, String> mdcContextMapToLink); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable,
                                                      Pair<Deque<Span>, Map<String, String>> threadInfoToLink); @Deprecated static Callable<U> callableWithTracing(Callable<U> callable,
                                                      Deque<Span> spanStackToLink,
                                                      Map<String, String> mdcContextMapToLink); @Deprecated static ExecutorServiceWithTracing executorServiceWithTracing(ExecutorService delegate); @Deprecated static ScheduledExecutorServiceWithTracing scheduledExecutorServiceWithTracing(
        ScheduledExecutorService delegate
    ); @Deprecated static TracingState linkTracingToCurrentThread(
        Pair<Deque<Span>, Map<String, String>> threadInfoToLink
    ); @Deprecated static TracingState linkTracingToCurrentThread(
        Deque<Span> spanStackToLink,
        Map<String, String> mdcContextMapToLink
    ); @Deprecated static void unlinkTracingFromCurrentThread(
        Pair<Deque<Span>, Map<String, String>> threadInfoToResetFor
    ); @Deprecated static void unlinkTracingFromCurrentThread(Deque<Span> spanStackToResetFor,
                                                      Map<String, String> mdcContextMapToResetFor);  }