use of org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory in project jhipster-sample-app-oauth2 by jhipster.
the class WebConfigurerTest method testUndertowHttp2Enabled.
@Test
public void testUndertowHttp2Enabled() {
props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue();
}
use of org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory in project jhipster-sample-app-dto by jhipster.
the class WebConfigurerTest method testUndertowHttp2Enabled.
@Test
public void testUndertowHttp2Enabled() {
props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue();
}
use of org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory in project joinfaces by joinfaces.
the class UndertowAutoConfiguration method jsfUndertowFactoryCustomizer.
@Bean
public WebServerFactoryCustomizer<UndertowServletWebServerFactory> jsfUndertowFactoryCustomizer() {
return factory -> factory.addDeploymentInfoCustomizers(deploymentInfo -> {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
ClassLoader jsfClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());
deploymentInfo.setClassLoader(jsfClassLoader);
deploymentInfo.setResourceManager(new ClassPathResourceManager(jsfClassLoader, this.undertowProperties.getClassPathResource()));
return null;
});
log.info("Setting Undertow classLoader to {} directory", this.undertowProperties.getClassPathResource());
});
}
use of org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory 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();
}
Aggregations