Unify WebServerFactoryCustomizers

Replace `ReactiveWebServerCustomizer` and `WebServerFactoryCustomizer`
with a unified `WebServerFactoryCustomizer`.

Fixes gh-8558
This commit is contained in:
Phillip Webb
2017-03-14 15:48:02 -07:00
parent 13db69bf41
commit 099e188f9f
30 changed files with 487 additions and 403 deletions

View File

@@ -24,8 +24,8 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.embedded.TomcatLegacyCookieProcessorExample.LegacyCookieProcessorConfiguration;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor;
import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.boot.web.servlet.server.ServletWebServerFactoryCustomizerBeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -42,8 +42,8 @@ public class TomcatLegacyCookieProcessorExampleTests {
public void cookieProcessorIsCustomized() {
ServletWebServerApplicationContext applicationContext = (ServletWebServerApplicationContext) new SpringApplication(
TestConfiguration.class, LegacyCookieProcessorConfiguration.class).run();
Context context = (Context) ((TomcatWebServer) applicationContext
.getWebServer()).getTomcat().getHost().findChildren()[0];
Context context = (Context) ((TomcatWebServer) applicationContext.getWebServer())
.getTomcat().getHost().findChildren()[0];
assertThat(context.getCookieProcessor())
.isInstanceOf(LegacyCookieProcessor.class);
}
@@ -57,8 +57,8 @@ public class TomcatLegacyCookieProcessorExampleTests {
}
@Bean
public ServletWebServerFactoryCustomizerBeanPostProcessor postProcessor() {
return new ServletWebServerFactoryCustomizerBeanPostProcessor();
public WebServerFactoryCustomizerBeanPostProcessor postProcessor() {
return new WebServerFactoryCustomizerBeanPostProcessor();
}
}