WingtipsSpringWebfluxWebFilter implements WebFilter, Ordered { protected static @Nullable String determineUriPathTemplate(@NotNull ServerWebExchange exchange) { String path = getRequestAttributeAsString(exchange, KnownZipkinTags.HTTP_ROUTE); if (StringUtils.isNotBlank(path)) { return path; } path = getRequestAttributeAsString(exchange, HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); if (StringUtils.isNotBlank(path)) { return path; } return null; } WingtipsSpringWebfluxWebFilter();  WingtipsSpringWebfluxWebFilter(Builder builder); static Builder newBuilder(); @Override @NotNull Mono<Void> filter(@NotNull ServerWebExchange exchange, @NotNull WebFilterChain chain); @Override int getOrder(); void setOrder(int order);  }
@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 determineUriPathTemplate_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 "; } if (httpRouteRequestAttr != null) { exchange.getAttributes().put(KnownZipkinTags.HTTP_ROUTE, httpRouteRequestAttr); } if (springMatchingPatternRequestAttr != null) { exchange.getAttributes().put(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, springMatchingPatternRequestAttr); } String result = WingtipsSpringWebfluxWebFilter.determineUriPathTemplate(exchange); assertThat(result).isEqualTo(expectedResult); }