WingtipsHttpClientBuilder extends HttpClientBuilder { public static WingtipsHttpClientBuilder create() { return new WingtipsHttpClientBuilder(); } WingtipsHttpClientBuilder();  WingtipsHttpClientBuilder(boolean surroundCallsWithSubspan);  WingtipsHttpClientBuilder(
        boolean surroundCallsWithSubspan,
        HttpTagAndSpanNamingStrategy<HttpRequest, HttpResponse> tagAndNamingStrategy,
        HttpTagAndSpanNamingAdapter<HttpRequest, HttpResponse> tagAndNamingAdapter
    ); static WingtipsHttpClientBuilder create(); static WingtipsHttpClientBuilder create(boolean surroundCallsWithSubspan); static WingtipsHttpClientBuilder create(
        boolean surroundCallsWithSubspan,
        HttpTagAndSpanNamingStrategy<HttpRequest, HttpResponse> tagAndNamingStrategy,
        HttpTagAndSpanNamingAdapter<HttpRequest, HttpResponse> tagAndNamingAdapter
    ); boolean isSurroundCallsWithSubspan(); WingtipsHttpClientBuilder setSurroundCallsWithSubspan(boolean surroundCallsWithSubspan);  }
@Test public void zero_arg_create_factory_method_sets_fields_as_expected() { WingtipsHttpClientBuilder impl = WingtipsHttpClientBuilder.create(); assertThat(impl.surroundCallsWithSubspan).isTrue(); assertThat(impl.tagAndNamingStrategy).isSameAs(ZipkinHttpTagStrategy.getDefaultInstance()); assertThat(impl.tagAndNamingAdapter).isSameAs(ApacheHttpClientTagAdapter.getDefaultInstance()); }
@DataProvider(value = { "true", "false" }) @Test public void single_arg_create_factory_method_sets_fields_as_expected(boolean argValue) { WingtipsHttpClientBuilder impl = WingtipsHttpClientBuilder.create(argValue); assertThat(impl.surroundCallsWithSubspan).isEqualTo(argValue); assertThat(impl.tagAndNamingStrategy).isSameAs(ZipkinHttpTagStrategy.getDefaultInstance()); assertThat(impl.tagAndNamingAdapter).isSameAs(ApacheHttpClientTagAdapter.getDefaultInstance()); }
@DataProvider(value = { "true", "false" }) @Test public void create_factory_method_with_tag_and_span_naming_args_sets_fields_as_expected(boolean subspanArgValue) { WingtipsHttpClientBuilder impl = WingtipsHttpClientBuilder.create( subspanArgValue, tagAndNamingStrategy, tagAndNamingAdapterMock ); assertThat(impl.surroundCallsWithSubspan).isEqualTo(subspanArgValue); assertThat(impl.tagAndNamingStrategy).isSameAs(tagAndNamingStrategy); assertThat(impl.tagAndNamingAdapter).isSameAs(tagAndNamingAdapterMock); }
@DataProvider(value = { "NULL_STRATEGY_ARG", "NULL_ADAPTER_ARG" }) @Test public void create_factory_method_with_tag_and_span_naming_args_throws_IllegalArgumentException_if_passed_null_args( NullConstructorArgsScenario scenario ) { Throwable ex = catchThrowable( () -> WingtipsHttpClientBuilder.create(true, scenario.strategy, scenario.adapter) ); assertThat(ex) .isInstanceOf(IllegalArgumentException.class) .hasMessage(scenario.expectedExceptionMessage); }