@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); ListenableFutureCallbackWithTracing instance = (useStaticFactory) ? withTracing(listenableFutureCallbackMock, Pair.of(spanStackMock, mdcInfoMock)) : new ListenableFutureCallbackWithTracing(listenableFutureCallbackMock, Pair.of(spanStackMock, mdcInfoMock) ); 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);  }