@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(); ListenableFutureCallbackWithTracing instance = (useStaticFactory) ? withTracing(listenableFutureCallbackMock) : new ListenableFutureCallbackWithTracing(listenableFutureCallbackMock); assertThat(instance.origListenableFutureCallback).isSameAs(listenableFutureCallbackMock); assertThat(instance.spanStackForExecution).isEqualTo(spanStackMock); assertThat(instance.mdcContextMapForExecution).isEqualTo(mdcInfoMock); }
public static <T> ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback) { return new ListenableFutureCallbackWithTracing<>(origListenableFutureCallback); }
ListenableFutureCallbackWithTracing implements ListenableFutureCallback<T> { public static <T> ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback) { return new ListenableFutureCallbackWithTracing<>(origListenableFutureCallback); } }
ListenableFutureCallbackWithTracing implements ListenableFutureCallback<T> { public static <T> ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback) { return new ListenableFutureCallbackWithTracing<>(origListenableFutureCallback); } ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Deque<Span> spanStackForExecution,
                                               Map<String, String> mdcContextMapForExecution); }
ListenableFutureCallbackWithTracing implements ListenableFutureCallback<T> { public static <T> ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback) { return new ListenableFutureCallbackWithTracing<>(origListenableFutureCallback); } ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Deque<Span> spanStackForExecution,
                                               Map<String, String> mdcContextMapForExecution); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                                                         Pair<Deque<Span>, Map<String, String>> originalThreadInfo); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                                                         Deque<Span> spanStackForExecution,
                                                                         Map<String, String> mdcContextMapForExecution); @Override @SuppressWarnings("deprecation") void onSuccess(T result); @Override @SuppressWarnings("deprecation") void onFailure(Throwable ex); }
ListenableFutureCallbackWithTracing implements ListenableFutureCallback<T> { public static <T> ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback) { return new ListenableFutureCallbackWithTracing<>(origListenableFutureCallback); } ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Pair<Deque<Span>, Map<String, String>> originalThreadInfo);  ListenableFutureCallbackWithTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                               Deque<Span> spanStackForExecution,
                                               Map<String, String> mdcContextMapForExecution); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                                                         Pair<Deque<Span>, Map<String, String>> originalThreadInfo); static ListenableFutureCallbackWithTracing<T> withTracing(ListenableFutureCallback<T> origListenableFutureCallback,
                                                                         Deque<Span> spanStackForExecution,
                                                                         Map<String, String> mdcContextMapForExecution); @Override @SuppressWarnings("deprecation") void onSuccess(T result); @Override @SuppressWarnings("deprecation") void onFailure(Throwable ex);  }