Search in sources :

Example 1 with HttpsConnectorConfig

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));
}
Also used : HttpsConnectorConfig(com.hotels.styx.server.HttpsConnectorConfig) NettyServerConfig(com.hotels.styx.server.netty.NettyServerConfig) Test(org.junit.jupiter.api.Test)

Aggregations

HttpsConnectorConfig (com.hotels.styx.server.HttpsConnectorConfig)1 NettyServerConfig (com.hotels.styx.server.netty.NettyServerConfig)1 Test (org.junit.jupiter.api.Test)1