Search in sources :

Example 1 with HttpsListener

use of org.wildfly.swarm.config.undertow.server.HttpsListener in project wildfly-swarm by wildfly-swarm.

the class HTTP2CustomizerTest method testHTTP2Enabled.

@Test
public void testHTTP2Enabled() {
    HTTP2Customizer customizer = new HTTP2Customizer();
    customizer.undertow = new UndertowFraction().applyDefaults();
    Server server = customizer.undertow.subresources().server(UndertowProperties.DEFAULT_SERVER);
    AtomicReference<HttpsListener> listener = new AtomicReference<>();
    server.httpsListener("default-https", (config) -> {
        listener.set(config);
    });
    assertThat(listener.get()).isNotNull();
    assertThat(listener.get().enableHttp2()).isNull();
    customizer.customize();
    assertThat(listener.get().enableHttp2()).isTrue();
}
Also used : UndertowFraction(org.wildfly.swarm.undertow.UndertowFraction) Server(org.wildfly.swarm.config.undertow.Server) AtomicReference(java.util.concurrent.atomic.AtomicReference) HttpsListener(org.wildfly.swarm.config.undertow.server.HttpsListener) Test(org.junit.Test)

Aggregations

AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Test (org.junit.Test)1 Server (org.wildfly.swarm.config.undertow.Server)1 HttpsListener (org.wildfly.swarm.config.undertow.server.HttpsListener)1 UndertowFraction (org.wildfly.swarm.undertow.UndertowFraction)1