SpringHttpClientTagAdapter extends HttpTagAndSpanNamingAdapter<HttpRequest, ClientHttpResponse> { @Override public @Nullable Integer getResponseHttpStatus(@Nullable ClientHttpResponse response) { if (response == null) { return null; } try { return response.getRawStatusCode(); } catch (IOException ioe) { return null; } }  @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 = { "200", "300", "400", "500", "999" }) @Test public void getResponseHttpStatus_returns_value_from_response_getRawStatusCode( int responseMethodValue ) throws IOException { doReturn(responseMethodValue).when(responseMock).getRawStatusCode(); Integer result = implSpy.getResponseHttpStatus(responseMock); assertThat(result).isEqualTo(responseMethodValue); verify(responseMock).getRawStatusCode(); }
@Test public void getResponseHttpStatus_returns_null_when_passed_null() { assertThat(implSpy.getResponseHttpStatus(null)).isNull(); }
@Test public void getResponseHttpStatus_returns_null_when_response_getRawStatusCode_throws_IOException( ) throws IOException { doThrow(new IOException("intentional exception")).when(responseMock).getRawStatusCode(); Integer result = implSpy.getResponseHttpStatus(responseMock); assertThat(result).isNull(); verify(responseMock).getRawStatusCode(); }