diff --git a/spring-web/src/test/java/org/springframework/http/server/reactive/ErrorHandlerIntegrationTests.java b/spring-web/src/test/java/org/springframework/http/server/reactive/ErrorHandlerIntegrationTests.java index 79d0158eae9..f91779cba1b 100644 --- a/spring-web/src/test/java/org/springframework/http/server/reactive/ErrorHandlerIntegrationTests.java +++ b/spring-web/src/test/java/org/springframework/http/server/reactive/ErrorHandlerIntegrationTests.java @@ -27,6 +27,7 @@ import org.springframework.web.client.ResponseErrorHandler; import org.springframework.web.client.RestTemplate; import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests; import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer; +import org.springframework.web.testfixture.http.server.reactive.bootstrap.JettyHttpServer; import static org.assertj.core.api.Assertions.assertThat; @@ -80,7 +81,14 @@ class ErrorHandlerIntegrationTests extends AbstractHttpHandlerIntegrationTests { URI url = new URI("http://localhost:" + port + "//"); ResponseEntity response = restTemplate.getForEntity(url, String.class); - assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + // Jetty 10+ rejects empty path segments, see https://github.com/eclipse/jetty.project/issues/6302, + // but an application can apply CompactPathRule via RewriteHandler: + // https://www.eclipse.org/jetty/documentation/jetty-11/programming_guide.php + + HttpStatus expectedStatus = + (httpServer instanceof JettyHttpServer ? HttpStatus.BAD_REQUEST : HttpStatus.OK); + + assertThat(response.getStatusCode()).isEqualTo(expectedStatus); }