use of org.wildfly.swarm.undertow.UndertowFraction in project wildfly-swarm by wildfly-swarm.
the class UndertowSocketBindingsCustomizerTest method testDefaultPorts.
@Test
public void testDefaultPorts() {
UndertowSocketBindingsCustomizer customizer = new UndertowSocketBindingsCustomizer();
customizer.fraction = new UndertowFraction();
customizer.group = new SocketBindingGroup("standard-sockets", "public", "0");
customizer.customize();
assertThat(customizer.group.socketBindings()).hasSize(2);
SocketBinding http = customizer.group.socketBinding("http");
assertThat(http).isNotNull();
assertThat(http.portExpression()).isEqualTo("8080");
SocketBinding https = customizer.group.socketBinding("https");
assertThat(https).isNotNull();
assertThat(https.portExpression()).isEqualTo("8443");
}
use of org.wildfly.swarm.undertow.UndertowFraction in project wildfly-swarm by wildfly-swarm.
the class UndertowSocketBindingsCustomizerTest method testExplicitHttpsPort.
@Test
public void testExplicitHttpsPort() {
UndertowSocketBindingsCustomizer customizer = new UndertowSocketBindingsCustomizer();
customizer.fraction = new UndertowFraction();
customizer.fraction.httpsPort(8675);
customizer.group = new SocketBindingGroup("standard-sockets", "public", "0");
customizer.customize();
assertThat(customizer.group.socketBindings()).hasSize(2);
SocketBinding http = customizer.group.socketBinding("http");
assertThat(http).isNotNull();
assertThat(http.portExpression()).isEqualTo("8080");
SocketBinding https = customizer.group.socketBinding("https");
assertThat(https).isNotNull();
assertThat(https.portExpression()).isEqualTo("8675");
}
use of org.wildfly.swarm.undertow.UndertowFraction in project wildfly-swarm by wildfly-swarm.
the class InUndertowInstaller method customize.
public void customize() {
if (!undertowFractionInstance.isUnsatisfied()) {
UndertowFraction undertow = undertowFractionInstance.get();
if (undertow.subresources().filterConfiguration() == null) {
undertow.filterConfiguration();
}
undertow.subresources().filterConfiguration().customFilter("wfs-mp-metrics", customFilter -> {
customFilter.module("org.wildfly.swarm.microprofile.metrics:runtime");
customFilter.className("org.wildfly.swarm.microprofile.metrics.runtime.MetricsHttpHandler");
});
undertow.subresources().server("default-server").subresources().host("default-host").filterRef("wfs-mp-metrics", f -> {
f.priority(101);
});
} else {
throw new RuntimeException("The monitor fraction requires the undertow fraction!");
}
}
use of org.wildfly.swarm.undertow.UndertowFraction in project wildfly-swarm by wildfly-swarm.
the class UndertowFilterCustomizer method customize.
@Override
public void customize() {
if (!undertowFractionInstance.isUnsatisfied()) {
UndertowFraction undertow = undertowFractionInstance.get();
if (undertow.subresources().filterConfiguration() == null) {
undertow.filterConfiguration();
}
undertow.subresources().filterConfiguration().customFilter("wfs-monitor", customFilter -> {
customFilter.module("org.wildfly.swarm.monitor:runtime");
customFilter.className("org.wildfly.swarm.monitor.runtime.SecureHttpContexts");
});
undertow.subresources().server("default-server").subresources().host("default-host").filterRef("wfs-monitor", f -> {
f.priority(100);
});
} else {
throw new RuntimeException("The monitor fraction requires the undertow fraction!");
}
}
use of org.wildfly.swarm.undertow.UndertowFraction in project wildfly-swarm by wildfly-swarm.
the class CertInfoProducerTest method testDefaults.
@Test
public void testDefaults() {
CertInfoProducer producer = new CertInfoProducer();
producer.undertow = new UndertowFraction();
CertInfo certInfo = producer.produceCertInfo();
assertThat(certInfo).isNotNull();
assertThat(certInfo.generateSelfSignedCertificateHost()).isNull();
}
Aggregations