Search in sources :

Example 1 with QosClientConfig

use of com.palantir.atlasdb.qos.config.QosClientConfig in project atlasdb by palantir.

the class QosClientConfigDeserializationTest method canDeserializeFromYaml.

@Test
public void canDeserializeFromYaml() throws IOException {
    QosClientConfig expected = ImmutableQosClientConfig.builder().qosService(ServiceConfiguration.builder().addUris("http://localhost:8080").security(SslConfiguration.of(Paths.get("trustStore.jks"))).build()).maxBackoffSleepTime(HumanReadableDuration.seconds(20)).limits(ImmutableQosLimitsConfig.builder().readBytesPerSecond(123).writeBytesPerSecond(456).build()).build();
    File configFile = new File(QosServiceRuntimeConfig.class.getResource("/qos-client.yml").getPath());
    QosClientConfig config = OBJECT_MAPPER.readValue(configFile, QosClientConfig.class);
    assertThat(config).isEqualTo(expected);
}
Also used : ImmutableQosClientConfig(com.palantir.atlasdb.qos.config.ImmutableQosClientConfig) QosClientConfig(com.palantir.atlasdb.qos.config.QosClientConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

ImmutableQosClientConfig (com.palantir.atlasdb.qos.config.ImmutableQosClientConfig)1 QosClientConfig (com.palantir.atlasdb.qos.config.QosClientConfig)1 File (java.io.File)1 Test (org.junit.Test)1