From 9c438a8f7831d4841b82149f317804a262946f94 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 5 Jul 2016 18:20:31 -0400 Subject: [PATCH] Fix failing test --- .../web/reactive/DispatcherHandlerErrorTests.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java index cbd70fab9c..affa9c3f75 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java @@ -17,6 +17,7 @@ package org.springframework.web.reactive; import java.net.URI; +import java.time.Duration; import java.util.Collections; import org.junit.Before; @@ -171,12 +172,9 @@ public class DispatcherHandlerErrorTests { WebExceptionHandler exceptionHandler = new ServerError500ExceptionHandler(); WebHandler webHandler = new ExceptionHandlingWebHandler(this.dispatcherHandler, exceptionHandler); - Mono publisher = webHandler.handle(this.exchange); - - TestSubscriber.subscribe(publisher) - .assertErrorWith(ex -> assertEquals( - HttpStatus.INTERNAL_SERVER_ERROR, this.exchange.getResponse().getStatusCode())); + webHandler.handle(this.exchange).block(Duration.ofSeconds(5)); + assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, this.exchange.getResponse().getStatusCode()); }