use of io.confluent.ksql.rest.entity.HealthCheckResponseDetail in project ksql by confluentinc.
the class KsqlClientTest method shouldRequestServerHealthcheck.
@Test
public void shouldRequestServerHealthcheck() {
// Given:
Map<String, HealthCheckResponseDetail> map = new HashMap<>();
map.put("foo", new HealthCheckResponseDetail(true));
HealthCheckResponse healthCheckResponse = new HealthCheckResponse(true, map);
server.setResponseObject(healthCheckResponse);
// When:
KsqlTarget target = ksqlClient.target(serverUri);
RestResponse<HealthCheckResponse> response = target.getServerHealth();
// Then:
assertThat(server.getHttpMethod(), is(HttpMethod.GET));
assertThat(server.getBody().length(), is(0));
assertThat(server.getPath(), is("/healthcheck"));
assertThat(server.getHeaders().get("Accept"), is("application/json"));
assertThat(response.get(), is(healthCheckResponse));
}
Aggregations