use of org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFactory in project spring-boot by spring-projects.
the class ReactiveWebServerFactoryAutoConfigurationTests method tomcatContextCustomizerBeanIsAddedToFactory.
@Test
void tomcatContextCustomizerBeanIsAddedToFactory() {
ReactiveWebApplicationContextRunner runner = new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new).withConfiguration(AutoConfigurations.of(ReactiveWebServerFactoryAutoConfiguration.class)).withUserConfiguration(HttpHandlerConfiguration.class, TomcatContextCustomizerConfiguration.class).withPropertyValues("server.port: 0");
runner.run((context) -> {
TomcatReactiveWebServerFactory factory = context.getBean(TomcatReactiveWebServerFactory.class);
TomcatContextCustomizer customizer = context.getBean("contextCustomizer", TomcatContextCustomizer.class);
assertThat(factory.getTomcatContextCustomizers()).contains(customizer);
then(customizer).should().customize(any(Context.class));
});
}
Aggregations