WingtipsSpringWebfluxWebFilter implements WebFilter, Ordered { protected @NotNull String getInitialSpanName( @NotNull ServerWebExchange exchange, @NotNull HttpTagAndSpanNamingStrategy<ServerWebExchange, ?> namingStrategy, @NotNull HttpTagAndSpanNamingAdapter<ServerWebExchange, ?> adapter ) { String spanNameFromStrategy = namingStrategy.getInitialSpanName(exchange, adapter); if (StringUtils.isNotBlank(spanNameFromStrategy)) { return spanNameFromStrategy; } String pathTemplate = determineUriPathTemplate(exchange); String method = exchange.getRequest().getMethodValue(); return HttpRequestTracingUtils.generateSafeSpanName(method, pathTemplate, (Integer)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 = { "spanNameFromStrategy | someHttpRoute | someSpringPattern | PATCH | spanNameFromStrategy", "null | someHttpRoute | someSpringPattern | PATCH | PATCH someHttpRoute", " | someHttpRoute | someSpringPattern | PATCH | PATCH someHttpRoute", "[whitespace] | someHttpRoute | someSpringPattern | PATCH | PATCH someHttpRoute", "null | null | someSpringPattern | PATCH | PATCH someSpringPattern", "null | | someSpringPattern | PATCH | PATCH someSpringPattern", "null | [whitespace] | someSpringPattern | PATCH | PATCH someSpringPattern", "null | null | null | PATCH | PATCH", "null | null | | PATCH | PATCH", "null | null | [whitespace] | PATCH | PATCH", }, splitBy = "\\|") @Test public void getInitialSpanName_works_as_expected( String strategyResult, String httpRouteAttr, String bestMatchingPatternAttr, String httpMethod, String expectedResult ) { if ("[whitespace]".equals(strategyResult)) { strategyResult = " \n\r\t "; } if ("[whitespace]".equals(httpRouteAttr)) { httpRouteAttr = " \n\r\t "; } if ("[whitespace]".equals(bestMatchingPatternAttr)) { bestMatchingPatternAttr = " \n\r\t "; } if ("[whitespace]".equals(httpMethod)) { httpMethod = " \n\r\t "; } initialSpanNameFromStrategy.set(strategyResult); if (httpRouteAttr != null) { exchange.getAttributes().put(KnownZipkinTags.HTTP_ROUTE, httpRouteAttr); } if (bestMatchingPatternAttr != null) { exchange.getAttributes().put(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, bestMatchingPatternAttr); } doReturn(httpMethod).when(requestMock).getMethodValue(); String result = filterSpy.getInitialSpanName(exchange, tagAndNamingStrategy, tagAndNamingAdapterMock); assertThat(result).isEqualTo(expectedResult); assertThat(strategyInitialSpanNameMethodCalled.get()).isTrue(); strategyInitialSpanNameArgs.get().verifyArgs(exchange, tagAndNamingAdapterMock); }