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