Complete initialization with bindToRouterFunction

Issue: SPR-17239
This commit is contained in:
Rossen Stoyanchev
2018-10-12 17:09:51 -04:00
parent 309e70a48e
commit ecd0d7f0f6
2 changed files with 80 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,7 +50,10 @@ class DefaultRouterFunctionSpec extends AbstractMockServerSpec<WebTestClient.Rou
@Override
protected WebHttpHandlerBuilder initHttpHandlerBuilder() {
WebHandler webHandler = RouterFunctions.toWebHandler(this.routerFunction, this.handlerStrategies);
return WebHttpHandlerBuilder.webHandler(webHandler);
return WebHttpHandlerBuilder.webHandler(webHandler)
.filters(filters -> filters.addAll(this.handlerStrategies.webFilters()))
.exceptionHandlers(handlers -> handlers.addAll(this.handlerStrategies.exceptionHandlers()))
.localeContextResolver(this.handlerStrategies.localeContextResolver());
}
}