Browse Source

Use a timeout != 0 in InvocableHandlerMethodTests

pull/23098/head
Sebastien Deleuze 7 years ago
parent
commit
23e617160f
  1. 7
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/InvocableHandlerMethodTests.java

7
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 @@ -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<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
@ -177,7 +180,7 @@ public class InvocableHandlerMethodTests { @@ -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 { @@ -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

Loading…
Cancel
Save