use of com.hotels.styx.server.HttpsConnectorConfig in project styx by ExpediaGroup.
the class NettyServerConfigTest method shouldCreateServerConfiguration.
@Test
public void shouldCreateServerConfiguration() {
String yaml = "" + "proxy:\n" + " compressResponses: true\n" + " connectors:\n" + " http:\n" + " port: 8080\n" + " https:\n" + " port: 8443\n" + " certificateFile: example.keystore\n" + " certificateKeyFile: example\n" + " validateCerts: true";
YamlConfig yamlConfig = new YamlConfig(yaml);
NettyServerConfig serverConfig = yamlConfig.get("proxy", NettyServerConfig.class).get();
assertThat(serverConfig.httpConnectorConfig().get().port(), is(8080));
HttpsConnectorConfig httpsConfig = new HttpsConnectorConfig.Builder().port(8443).certificateFile("example.keystore").certificateKeyFile("example").build();
assertThat(httpsConnectorConfig(serverConfig), is(httpsConfig));
assertThat(serverConfig.compressResponses(), is(true));
}
Aggregations