Skip to content

Commit 23e6171

Browse files
committed
Use a timeout != 0 in InvocableHandlerMethodTests
1 parent 2a19b8f commit 23e6171

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
*/
5959
public class InvocableHandlerMethodTests {
6060

61+
private static final Duration TIMEOUT = Duration.ofSeconds(5);
62+
63+
6164
private final MockServerWebExchange exchange = MockServerWebExchange.from(get("http://localhost:8080/path"));
6265

6366
private final List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
@@ -177,7 +180,7 @@ public void voidMonoMethodWithResponseArg() {
177180
HandlerResult result = invokeForResult(new TestController(), method);
178181

179182
assertThat(result).as("Expected no result (i.e. fully handled)").isNull();
180-
assertThat(this.exchange.getResponse().getBodyAsString().block(Duration.ZERO)).isEqualTo("body");
183+
assertThat(this.exchange.getResponse().getBodyAsString().block(TIMEOUT)).isEqualTo("body");
181184
}
182185

183186
@Test
@@ -197,7 +200,7 @@ public void voidMonoMethodWithExchangeArg() {
197200
HandlerResult result = invokeForResult(new TestController(), method);
198201

199202
assertThat(result).as("Expected no result (i.e. fully handled)").isNull();
200-
assertThat(this.exchange.getResponse().getBodyAsString().block(Duration.ZERO)).isEqualTo("body");
203+
assertThat(this.exchange.getResponse().getBodyAsString().block(TIMEOUT)).isEqualTo("body");
201204
}
202205

203206
@Test

0 commit comments

Comments
 (0)