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:
@@ -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}.
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user