Fix failing test

This commit is contained in:
Rossen Stoyanchev
2016-07-05 18:20:31 -04:00
parent 33b6dca2a6
commit 9c438a8f78

View File

@@ -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<Void> 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());
}