use of com.hotels.styx.api.extension.service.HealthCheckConfig in project styx by ExpediaGroup.
the class OriginHealthStatusMonitorFactoryTest method createsNoOpMonitorForAbsentHealthCheckUri.
@Test
public void createsNoOpMonitorForAbsentHealthCheckUri() {
HealthCheckConfig healthCheckConfig = newHealthCheckConfigBuilder().build();
assertThat(factory.create(id, healthCheckConfig, null, null), is(instanceOf(NoOriginHealthStatusMonitor.class)));
}
use of com.hotels.styx.api.extension.service.HealthCheckConfig in project styx by ExpediaGroup.
the class OriginHealthStatusMonitorFactoryTest method createsScheduledOriginStatusMonitor.
@Test
public void createsScheduledOriginStatusMonitor() {
HealthCheckConfig healthCheckConfig = newHealthCheckConfigBuilder().uri("/version.txt").interval(5, MILLISECONDS).build();
OriginHealthCheckFunction checkFunction = (client, origin, callback) -> {
};
assertThat(factory.create(id, healthCheckConfig, () -> checkFunction, mock(HttpClient.class)), is(instanceOf(AnomalyExcludingOriginHealthStatusMonitor.class)));
}
use of com.hotels.styx.api.extension.service.HealthCheckConfig in project styx by ExpediaGroup.
the class HealthCheckSettingsTest method configuresTheHealthCheckWithTheDefaultValues.
@Test
public void configuresTheHealthCheckWithTheDefaultValues() throws Exception {
HealthCheckConfig healthCheckConfig = newHealthCheckConfigBuilder().build();
assertThat(healthCheckConfig, is(newHealthCheckConfigBuilder().healthyThreshold(2).unhealthyThreshold(2).interval(5000, MILLISECONDS).timeout(2000, MILLISECONDS).build()));
}
Aggregations