use of com.hotels.styx.client.healthcheck.OriginHealthCheckFunction.OriginState.HEALTHY in project styx by ExpediaGroup.
the class UrlRequestHealthCheckTest method declaresOriginHealthyOnOkResponseCode.
@Test
public void declaresOriginHealthyOnOkResponseCode() {
HttpClient client = request -> respondWith(OK);
new UrlRequestHealthCheck("/version.txt", metrics).check(client, someOrigin, state -> this.originState = state);
assertThat(originState, is(HEALTHY));
assertThat(meters(id -> id.getName().equals("proxy.client.originHealthCheckFailures")).size(), is(0));
}
Aggregations