Skip to content

Commit 5abe5e1

Browse files
committed
Merge branch '6.1.x'
2 parents cee8b52 + 5e28a25 commit 5abe5e1

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

spring-webflux/src/test/java/org/springframework/web/reactive/FlushingIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response)
127127
String path = request.getURI().getPath();
128128
return switch (path) {
129129
case "/write-and-flush" -> response.writeAndFlushWith(
130-
testInterval(Duration.ofMillis(50), 2)
130+
testInterval(Duration.ofMillis(1), 2)
131131
.map(longValue -> wrap("data" + longValue + "\n", response))
132132
.map(Flux::just)
133133
.mergeWith(Flux.never()));

spring-webflux/src/test/java/org/springframework/web/reactive/function/server/SseHandlerFunctionIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void sseAsEvent(HttpServer httpServer) throws Exception {
125125

126126
private static class SseHandler {
127127

128-
private static final Flux<Long> INTERVAL = testInterval(Duration.ofMillis(100), 2);
128+
private static final Flux<Long> INTERVAL = testInterval(Duration.ofMillis(1), 2);
129129

130130
Mono<ServerResponse> string(ServerRequest request) {
131131
return ServerResponse.ok()

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/JacksonStreamingIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static class JacksonStreamingController {
109109
@GetMapping(value = "/stream",
110110
produces = { APPLICATION_NDJSON_VALUE, "application/stream+x-jackson-smile" })
111111
Flux<Person> person() {
112-
return testInterval(Duration.ofMillis(100), 50).map(l -> new Person("foo " + l));
112+
return testInterval(Duration.ofMillis(1), 50).map(l -> new Person("foo " + l));
113113
}
114114

115115
}

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ProtobufIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Flux<Msg> messages() {
168168

169169
@GetMapping(value = "/message-stream", produces = "application/x-protobuf;delimited=true")
170170
Flux<Msg> messageStream() {
171-
return testInterval(Duration.ofMillis(50), 5).map(l ->
171+
return testInterval(Duration.ofMillis(1), 5).map(l ->
172172
Msg.newBuilder().setFoo("Foo").setBlah(SecondMsg.newBuilder().setBlah(l.intValue()).build()).build());
173173
}
174174

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.function.Predicate;
2323

2424
import org.reactivestreams.Publisher;
25+
import reactor.core.publisher.Mono;
2526

2627
import org.springframework.context.ApplicationContext;
2728
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -34,6 +35,8 @@
3435
import org.springframework.http.ResponseEntity;
3536
import org.springframework.http.server.reactive.ServerHttpRequest;
3637
import org.springframework.web.bind.annotation.GetMapping;
38+
import org.springframework.web.bind.annotation.PostMapping;
39+
import org.springframework.web.bind.annotation.RequestBody;
3740
import org.springframework.web.bind.annotation.RequestMapping;
3841
import org.springframework.web.bind.annotation.RequestMethod;
3942
import org.springframework.web.bind.annotation.RestController;
@@ -116,6 +119,13 @@ void stream(HttpServer httpServer) throws Exception {
116119
assertThat(performGet("/stream", new HttpHeaders(), int[].class).getBody()).isEqualTo(expected);
117120
}
118121

122+
@ParameterizedHttpServerTest // gh-33739
123+
void requestBodyAndDelayedResponse(HttpServer httpServer) throws Exception {
124+
startServer(httpServer);
125+
126+
assertThat(performPost("/post", new HttpHeaders(), "text", String.class).getBody()).isEqualTo("text");
127+
}
128+
119129

120130
@Configuration
121131
@EnableWebFlux
@@ -177,8 +187,14 @@ public String uri(ServerHttpRequest request) {
177187

178188
@GetMapping("/stream")
179189
public Publisher<Long> stream() {
180-
return testInterval(Duration.ofMillis(50), 5);
190+
return testInterval(Duration.ofMillis(1), 5);
181191
}
192+
193+
@PostMapping("/post")
194+
public Mono<String> postDelayedInput(@RequestBody String text) {
195+
return Mono.just(text).delayElement(Duration.ofMillis(1));
196+
}
197+
182198
}
183199

184200

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void serverDetectsClientDisconnect(HttpServer httpServer, ClientHttpConnector co
203203
@RequestMapping("/sse")
204204
static class SseController {
205205

206-
private static final Flux<Long> INTERVAL = testInterval(Duration.ofMillis(100), 50);
206+
private static final Flux<Long> INTERVAL = testInterval(Duration.ofMillis(1), 50);
207207

208208
private final Sinks.Empty<Void> cancelSink = Sinks.empty();
209209

0 commit comments

Comments
 (0)