Remove ServerWebExchange dependency in ServerRequestObservationContext

Avoiding cycle between http.server and web.server packages.

See gh-30013
This commit is contained in:
Juergen Hoeller
2023-06-14 21:57:27 +02:00
parent 220995b830
commit f00a8cb3a3
7 changed files with 40 additions and 22 deletions

View File

@@ -137,7 +137,7 @@ class RouterFunctionMappingTests {
assertThat(matchingPattern.getPatternString()).isEqualTo("/match");
assertThat(org.springframework.web.filter.reactive.ServerHttpObservationFilter.findObservationContext(exchange))
.hasValueSatisfying(context -> assertThat(context.getPathPattern()).isEqualTo(matchingPattern.getPatternString()));
assertThat(ServerRequestObservationContext.findCurrent(exchange))
assertThat(ServerRequestObservationContext.findCurrent(exchange.getAttributes()))
.hasValueSatisfying(context -> assertThat(context.getPathPattern()).isEqualTo(matchingPattern.getPatternString()));
ServerRequest serverRequest = exchange.getAttribute(RouterFunctions.REQUEST_ATTRIBUTE);