@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(); BiConsumerWithTracing instance = (useStaticFactory) ? withTracing(biConsumerMock) : new BiConsumerWithTracing(biConsumerMock); assertThat(instance.origBiConsumer).isSameAs(biConsumerMock); assertThat(instance.spanStackForExecution).isEqualTo(spanStackMock); assertThat(instance.mdcContextMapForExecution).isEqualTo(mdcInfoMock); }
public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) { return new BiConsumerWithTracing<>(origBiConsumer); }
BiConsumerWithTracing implements BiConsumer<T, U> { public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) { return new BiConsumerWithTracing<>(origBiConsumer); } }
BiConsumerWithTracing implements BiConsumer<T, U> { public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) { return new BiConsumerWithTracing<>(origBiConsumer); } BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Deque<Span> spanStackForExecution,
                                 Map<String, String> mdcContextMapForExecution); }
BiConsumerWithTracing implements BiConsumer<T, U> { public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) { return new BiConsumerWithTracing<>(origBiConsumer); } BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Deque<Span> spanStackForExecution,
                                 Map<String, String> mdcContextMapForExecution); static BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer); static BiConsumerWithTracing<T, U> withTracing(
        BiConsumer<T, U> origBiConsumer,
        Pair<Deque<Span>, Map<String, String>> originalThreadInfo
    ); static BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer,
                                                                 Deque<Span> spanStackForExecution,
                                                                 Map<String, String> mdcContextMapForExecution); @Override void accept(T t, U u); }
BiConsumerWithTracing implements BiConsumer<T, U> { public static <T, U> BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer) { return new BiConsumerWithTracing<>(origBiConsumer); } BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  BiConsumerWithTracing(BiConsumer<T, U> origBiConsumer,
                                 Deque<Span> spanStackForExecution,
                                 Map<String, String> mdcContextMapForExecution); static BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer); static BiConsumerWithTracing<T, U> withTracing(
        BiConsumer<T, U> origBiConsumer,
        Pair<Deque<Span>, Map<String, String>> originalThreadInfo
    ); static BiConsumerWithTracing<T, U> withTracing(BiConsumer<T, U> origBiConsumer,
                                                                 Deque<Span> spanStackForExecution,
                                                                 Map<String, String> mdcContextMapForExecution); @Override void accept(T t, U u);  }