@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(); FunctionWithTracing instance = (useStaticFactory) ? withTracing(functionMock) : new FunctionWithTracing(functionMock); assertThat(instance.origFunction).isSameAs(functionMock); assertThat(instance.spanStackForExecution).isEqualTo(spanStackMock); assertThat(instance.mdcContextMapForExecution).isEqualTo(mdcInfoMock); }
public static <T, U> FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction) { return new FunctionWithTracing<>(origFunction); }
FunctionWithTracing implements Function<T, U> { public static <T, U> FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction) { return new FunctionWithTracing<>(origFunction); } }
FunctionWithTracing implements Function<T, U> { public static <T, U> FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction) { return new FunctionWithTracing<>(origFunction); } FunctionWithTracing(Function<T, U> origFunction);  FunctionWithTracing(Function<T, U> origFunction,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  FunctionWithTracing(Function<T, U> origFunction,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); }
FunctionWithTracing implements Function<T, U> { public static <T, U> FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction) { return new FunctionWithTracing<>(origFunction); } FunctionWithTracing(Function<T, U> origFunction);  FunctionWithTracing(Function<T, U> origFunction,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  FunctionWithTracing(Function<T, U> origFunction,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); static FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction); static FunctionWithTracing<T, U> withTracing(
        Function<T, U> origFunction,
        Pair<Deque<Span>, Map<String, String>> originalThreadInfo
    ); static FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction,
                                                               Deque<Span> spanStackForExecution,
                                                               Map<String, String> mdcContextMapForExecution); @Override U apply(T t); }
FunctionWithTracing implements Function<T, U> { public static <T, U> FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction) { return new FunctionWithTracing<>(origFunction); } FunctionWithTracing(Function<T, U> origFunction);  FunctionWithTracing(Function<T, U> origFunction,
                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  FunctionWithTracing(Function<T, U> origFunction,
                               Deque<Span> spanStackForExecution,
                               Map<String, String> mdcContextMapForExecution); static FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction); static FunctionWithTracing<T, U> withTracing(
        Function<T, U> origFunction,
        Pair<Deque<Span>, Map<String, String>> originalThreadInfo
    ); static FunctionWithTracing<T, U> withTracing(Function<T, U> origFunction,
                                                               Deque<Span> spanStackForExecution,
                                                               Map<String, String> mdcContextMapForExecution); @Override U apply(T t);  }