SpringWebfluxServerRequestTagAdapter extends HttpTagAndSpanNamingAdapter<ServerWebExchange, ServerHttpResponse> { @Override public @Nullable String getRequestUriPathTemplate( @Nullable ServerWebExchange exchange, @Nullable ServerHttpResponse response ) { if (exchange == null) { return null; } return WingtipsSpringWebfluxWebFilter.determineUriPathTemplate(exchange); }  static SpringWebfluxServerRequestTagAdapter getDefaultInstance(); @Override @Nullable String getErrorResponseTagValue(@Nullable ServerHttpResponse response); @Override @Nullable String getRequestUrl(@Nullable ServerWebExchange exchange); @Override @Nullable Integer getResponseHttpStatus(@Nullable ServerHttpResponse response); @Override @Nullable String getRequestHttpMethod(@Nullable ServerWebExchange exchange); @Override @Nullable String getRequestPath(@Nullable ServerWebExchange exchange); @Override @Nullable String getRequestUriPathTemplate(
        @Nullable ServerWebExchange exchange,
        @Nullable ServerHttpResponse response
    ); @Override @Nullable String getHeaderSingleValue(@Nullable ServerWebExchange exchange, @NotNull String headerKey); @Override @Nullable List<String> getHeaderMultipleValue(
        @Nullable ServerWebExchange exchange, @NotNull String headerKey
    ); @Override @Nullable String getSpanHandlerTagValue(
        @Nullable ServerWebExchange exchange, @Nullable ServerHttpResponse response
    );  }
@DataProvider(value = { "/some/http/route | /some/spring/pattern | /some/http/route", "/some/http/route | null | /some/http/route", "/some/http/route | | /some/http/route", "/some/http/route | [whitespace] | /some/http/route", "null | /some/spring/pattern | /some/spring/pattern", " | /some/spring/pattern | /some/spring/pattern", "[whitespace] | /some/spring/pattern | /some/spring/pattern", "null | null | null", " | | null", "[whitespace] | [whitespace] | null", }, splitBy = "\\|") @Test public void getRequestUriPathTemplate_works_as_expected( String httpRouteRequestAttr, String springMatchingPatternRequestAttr, String expectedResult ) { if ("[whitespace]".equals(httpRouteRequestAttr)) { httpRouteRequestAttr = " \t\r\n "; } if ("[whitespace]".equals(springMatchingPatternRequestAttr)) { springMatchingPatternRequestAttr = " \t\r\n "; } doReturn(httpRouteRequestAttr).when(exchangeMock).getAttribute(KnownZipkinTags.HTTP_ROUTE); doReturn(springMatchingPatternRequestAttr) .when(exchangeMock).getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); String result = adapterSpy.getRequestUriPathTemplate(exchangeMock, responseMock); assertThat(result).isEqualTo(expectedResult); }
@Test public void getRequestUriPathTemplate_returns_null_when_passed_null_exchange() { assertThat(adapterSpy.getRequestUriPathTemplate(null, responseMock)).isNull(); }