@DataProvider(value = { "true | true | true", "true | false | true", "false | true | true", "false | false | true", "true | true | false", "true | false | false", "false | true | false", "false | false | false", }, splitBy = "\\|") @Test public void pair_constructor_sets_fields_as_expected( boolean nullSpanStack, boolean nullMdcInfo, boolean useStaticFactory ) { Deque<Span> spanStackMock = (nullSpanStack) ? null : mock(Deque.class); Map<String, String> mdcInfoMock = (nullMdcInfo) ? null : mock(Map.class); ConsumerWithTracing instance = (useStaticFactory) ? withTracing(consumerMock, Pair.of(spanStackMock, mdcInfoMock)) : new ConsumerWithTracing(consumerMock, Pair.of(spanStackMock, mdcInfoMock) ); 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);  }