From 23e617160f196cd258ad36b2e908aeb58e50d340 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Wed, 5 Jun 2019 11:52:08 +0200 Subject: [PATCH] Use a timeout != 0 in InvocableHandlerMethodTests --- .../result/method/InvocableHandlerMethodTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java index 4feff4680de..cbef4c21c00 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java @@ -58,6 +58,9 @@ import static org.springframework.mock.http.server.reactive.test.MockServerHttpR */ public class InvocableHandlerMethodTests { + private static final Duration TIMEOUT = Duration.ofSeconds(5); + + private final MockServerWebExchange exchange = MockServerWebExchange.from(get("http://localhost:8080/path")); private final List resolvers = new ArrayList<>(); @@ -177,7 +180,7 @@ public class InvocableHandlerMethodTests { HandlerResult result = invokeForResult(new TestController(), method); assertThat(result).as("Expected no result (i.e. fully handled)").isNull(); - assertThat(this.exchange.getResponse().getBodyAsString().block(Duration.ZERO)).isEqualTo("body"); + assertThat(this.exchange.getResponse().getBodyAsString().block(TIMEOUT)).isEqualTo("body"); } @Test @@ -197,7 +200,7 @@ public class InvocableHandlerMethodTests { HandlerResult result = invokeForResult(new TestController(), method); assertThat(result).as("Expected no result (i.e. fully handled)").isNull(); - assertThat(this.exchange.getResponse().getBodyAsString().block(Duration.ZERO)).isEqualTo("body"); + assertThat(this.exchange.getResponse().getBodyAsString().block(TIMEOUT)).isEqualTo("body"); } @Test