Consumer methods for WebHttpHandlerBuilder

Replace the more limited List-based methods to add filtes and exception
handlers with Consumer<List<?>> variants.
This commit is contained in:
Rossen Stoyanchev
2017-06-23 07:12:10 -04:00
parent 782c595cf7
commit c37c59f578
7 changed files with 32 additions and 55 deletions

View File

@@ -36,8 +36,8 @@ import org.springframework.web.server.WebExceptionHandler;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebHandler;
import static java.time.Duration.*;
import static org.junit.Assert.*;
import static java.time.Duration.ofMillis;
import static org.junit.Assert.assertEquals;
/**
* Unit tests for {@link WebHttpHandlerBuilder}.

View File

@@ -119,8 +119,8 @@ public class FilteringWebHandlerTests {
TestExceptionHandler exceptionHandler = new TestExceptionHandler();
WebHttpHandlerBuilder.webHandler(new StubWebHandler())
.filters(Collections.singletonList(new ExceptionFilter()))
.exceptionHandlers(Collections.singletonList(exceptionHandler)).build()
.filter(new ExceptionFilter())
.exceptionHandler(exceptionHandler).build()
.handle(request, response)
.block();