From 21613eabf132e67810408d5addc9d93ce86e992d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Thu, 24 Aug 2023 10:46:43 +0200 Subject: [PATCH] Properly use Reactor Netty 2 in AbstractHttpHandlerIntegrationTests Closes gh-31095 --- .../AbstractHttpHandlerIntegrationTests.java | 2 +- .../MultipartRouterFunctionIntegrationTests.java | 14 ++++++++++++++ .../MultipartWebClientIntegrationTests.java | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/AbstractHttpHandlerIntegrationTests.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/AbstractHttpHandlerIntegrationTests.java index 2db1114fe4..509f7a10cf 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/AbstractHttpHandlerIntegrationTests.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/AbstractHttpHandlerIntegrationTests.java @@ -127,7 +127,7 @@ public abstract class AbstractHttpHandlerIntegrationTests { return Stream.of( named("Jetty", new JettyHttpServer()), named("Reactor Netty", new ReactorHttpServer()), - named("Reactor Netty 2", new ReactorHttpServer()), + named("Reactor Netty 2", new ReactorNetty2HttpServer()), named("Tomcat", new TomcatHttpServer()), named("Undertow", new UndertowHttpServer()) ); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartRouterFunctionIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartRouterFunctionIntegrationTests.java index 89659613dd..b8add26a60 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartRouterFunctionIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartRouterFunctionIntegrationTests.java @@ -49,6 +49,7 @@ import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer; +import org.springframework.web.testfixture.http.server.reactive.bootstrap.ReactorNetty2HttpServer; import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer; import static org.assertj.core.api.Assertions.assertThat; @@ -68,6 +69,9 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte @ParameterizedHttpServerTest void multipartData(HttpServer httpServer) throws Exception { + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); + startServer(httpServer); Mono> result = webClient @@ -86,6 +90,9 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte @ParameterizedHttpServerTest void parts(HttpServer httpServer) throws Exception { + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); + startServer(httpServer); Mono> result = webClient @@ -106,6 +113,8 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte void transferTo(HttpServer httpServer) throws Exception { // TODO Determine why Undertow fails: https://github.com/spring-projects/spring-framework/issues/25310 assumeFalse(httpServer instanceof UndertowHttpServer, "Undertow currently fails with transferTo"); + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); verifyTransferTo(httpServer); } @@ -145,6 +154,9 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte @ParameterizedHttpServerTest void partData(HttpServer httpServer) throws Exception { + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); + startServer(httpServer); Mono> result = webClient @@ -164,6 +176,8 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte @ParameterizedHttpServerTest void proxy(HttpServer httpServer) throws Exception { assumeFalse(httpServer instanceof UndertowHttpServer, "Undertow currently fails proxying requests"); + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); startServer(httpServer); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartWebClientIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartWebClientIntegrationTests.java index f8f9328a73..22b0bf2b43 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartWebClientIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartWebClientIntegrationTests.java @@ -60,6 +60,7 @@ import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.server.adapter.WebHttpHandlerBuilder; 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.ReactorNetty2HttpServer; import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer; import static org.assertj.core.api.Assertions.assertThat; @@ -87,6 +88,9 @@ class MultipartWebClientIntegrationTests extends AbstractHttpHandlerIntegrationT @ParameterizedHttpServerTest void requestPart(HttpServer httpServer) throws Exception { + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); + startServer(httpServer); Mono> result = webClient @@ -170,6 +174,8 @@ class MultipartWebClientIntegrationTests extends AbstractHttpHandlerIntegrationT void transferTo(HttpServer httpServer) throws Exception { // TODO Determine why Undertow fails: https://github.com/spring-projects/spring-framework/issues/25310 assumeFalse(httpServer instanceof UndertowHttpServer, "Undertow currently fails with transferTo"); + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); startServer(httpServer); @@ -189,6 +195,9 @@ class MultipartWebClientIntegrationTests extends AbstractHttpHandlerIntegrationT @ParameterizedHttpServerTest void modelAttribute(HttpServer httpServer) throws Exception { + // TODO Determine why Reactor Netty 2 fails: https://github.com/spring-projects/spring-framework/issues/31110 + assumeFalse(httpServer instanceof ReactorNetty2HttpServer, "Potential bug in Netty 5 multipart support"); + startServer(httpServer); Mono result = webClient