ApacheHttpClientTagAdapter extends HttpTagAndSpanNamingAdapter<HttpRequest, HttpResponse> { @Override public @Nullable String getRequestHttpMethod(@Nullable HttpRequest request) { if (request == null) { return null; } return request.getRequestLine().getMethod(); }  @SuppressWarnings("unchecked") static ApacheHttpClientTagAdapter getDefaultInstance(); @Override @Nullable String getRequestPath(@Nullable HttpRequest request); @Override @Nullable Integer getResponseHttpStatus(@Nullable HttpResponse response); @Override @Nullable String getRequestHttpMethod(@Nullable HttpRequest request); @Override @Nullable String getRequestUriPathTemplate(@Nullable HttpRequest request, @Nullable HttpResponse response); @Override @Nullable String getRequestUrl(@Nullable HttpRequest request); @Override @Nullable String getHeaderSingleValue(@Nullable HttpRequest request, @NotNull String headerKey); @Override @Nullable List<String> getHeaderMultipleValue(@Nullable HttpRequest request, @NotNull String headerKey); @Override @Nullable String getSpanHandlerTagValue(@Nullable HttpRequest request, @Nullable HttpResponse response);  }
@DataProvider(value = { "false | GET", "false | POST", "false | FOO", "false | null", "true | null" }, splitBy = "\\|") @Test public void getRequestHttpMethod_extracts_result_from_RequestLine( boolean requestIsNull, String expectedResult ) { requestMock = (requestIsNull) ? null : requestMock; doReturn(expectedResult).when(requestLineMock).getMethod(); String result = implSpy.getRequestHttpMethod(requestMock); assertThat(result).isEqualTo(expectedResult); }