use of org.springframework.boot.web.embedded.undertow.UndertowDeploymentInfoCustomizer in project joinfaces by joinfaces.
the class UndertowAutoConfigurationIT method customize.
@Test
public void customize() throws IOException {
UndertowServletWebServerFactory factory = new UndertowServletWebServerFactory();
this.undertowAutoConfiguration.jsfUndertowFactoryCustomizer().customize(factory);
UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer = factory.getDeploymentInfoCustomizers().iterator().next();
DeploymentInfo deploymentInfo = new DeploymentInfo();
undertowDeploymentInfoCustomizer.customize(deploymentInfo);
assertThat(deploymentInfo.getResourceManager().getResource("testUndertow.txt")).isNotNull();
}
use of org.springframework.boot.web.embedded.undertow.UndertowDeploymentInfoCustomizer in project spring-boot by spring-projects.
the class ServletWebServerFactoryAutoConfigurationTests method undertowDeploymentInfoCustomizerRegisteredAsBeanAndViaFactoryIsOnlyCalledOnce.
@Test
void undertowDeploymentInfoCustomizerRegisteredAsBeanAndViaFactoryIsOnlyCalledOnce() {
WebApplicationContextRunner runner = new WebApplicationContextRunner(AnnotationConfigServletWebServerApplicationContext::new).withClassLoader(new FilteredClassLoader(Tomcat.class, HttpServer.class, Server.class)).withConfiguration(AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class)).withUserConfiguration(DoubleRegistrationUndertowDeploymentInfoCustomizerConfiguration.class).withPropertyValues("server.port: 0");
runner.run((context) -> {
UndertowServletWebServerFactory factory = context.getBean(UndertowServletWebServerFactory.class);
UndertowDeploymentInfoCustomizer customizer = context.getBean("deploymentInfoCustomizer", UndertowDeploymentInfoCustomizer.class);
assertThat(factory.getDeploymentInfoCustomizers()).contains(customizer);
then(customizer).should().customize(any(DeploymentInfo.class));
});
}
Aggregations