diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java index b33e39a399..ca52e7a255 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; import org.reactivestreams.Publisher; +import reactor.core.publisher.Mono; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -34,6 +35,8 @@ import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -116,6 +119,13 @@ class RequestMappingIntegrationTests extends AbstractRequestMappingIntegrationTe assertThat(performGet("/stream", new HttpHeaders(), int[].class).getBody()).isEqualTo(expected); } + @ParameterizedHttpServerTest // gh-33739 + void requestBodyAndDelayedResponse(HttpServer httpServer) throws Exception { + startServer(httpServer); + + assertThat(performPost("/post", new HttpHeaders(), "text", String.class).getBody()).isEqualTo("text"); + } + @Configuration @EnableWebFlux @@ -179,6 +189,12 @@ class RequestMappingIntegrationTests extends AbstractRequestMappingIntegrationTe public Publisher stream() { return testInterval(Duration.ofMillis(1), 5); } + + @PostMapping("/post") + public Mono postDelayedInput(@RequestBody String text) { + return Mono.just(text).delayElement(Duration.ofMillis(1)); + } + }