SpringHttpClientTagAdapter extends HttpTagAndSpanNamingAdapter<HttpRequest, ClientHttpResponse> { @Override public @Nullable String getRequestHttpMethod(@Nullable HttpRequest request) { if (request == null) { return null; } HttpMethod method = request.getMethod(); return (method == null) ? "UNKNOWN_HTTP_METHOD" : method.name(); }  @SuppressWarnings("unchecked") static SpringHttpClientTagAdapter getDefaultInstance(); @Override @Nullable String getRequestUrl(@Nullable HttpRequest request); @Override @Nullable Integer getResponseHttpStatus(@Nullable ClientHttpResponse response); @Override @Nullable String getRequestHttpMethod(@Nullable HttpRequest request); @Override @Nullable String getRequestUriPathTemplate(
        @Nullable HttpRequest request,
        @Nullable ClientHttpResponse response
    ); @Override @Nullable String getRequestPath(@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 ClientHttpResponse response);  }
@DataProvider(value = { "GET | GET", "HEAD | HEAD", "POST | POST", "PUT | PUT", "PATCH | PATCH", "DELETE | DELETE", "OPTIONS | OPTIONS", "TRACE | TRACE", "null | UNKNOWN_HTTP_METHOD" }, splitBy = "\\|") @Test public void getRequestHttpMethod_works_as_expected(HttpMethod httpMethod, String expectedResult) { doReturn(httpMethod).when(requestMock).getMethod(); String result = implSpy.getRequestHttpMethod(requestMock); assertThat(result).isEqualTo(expectedResult); }
@Test public void getRequestHttpMethod_returns_null_when_passed_null() { assertThat(implSpy.getRequestHttpMethod(null)).isNull(); }