use of io.confluent.ksql.rest.entity.HeartbeatResponse in project ksql by confluentinc.
the class KsqlClientTest method shouldSendHeartbeatRequest.
@Test
public void shouldSendHeartbeatRequest() throws Exception {
// Given:
KsqlHostInfoEntity entity = new KsqlHostInfoEntity(serverUri.getHost(), serverUri.getPort());
long timestamp = System.currentTimeMillis();
server.setResponseObject(new HeartbeatResponse(true));
// When:
KsqlTarget target = ksqlClient.target(serverUri);
target.postAsyncHeartbeatRequest(entity, timestamp);
Buffer body = server.waitForRequestBody();
HeartbeatMessage hbm = KsqlClientUtil.deserialize(body, HeartbeatMessage.class);
// Then:
assertThat(server.getHttpMethod(), is(HttpMethod.POST));
assertThat(server.getPath(), is("/heartbeat"));
assertThat(server.getHeaders().get("Accept"), is("application/json"));
assertThat(hbm, is(new HeartbeatMessage(entity, timestamp)));
}
use of io.confluent.ksql.rest.entity.HeartbeatResponse in project ksql by confluentinc.
the class AuthorizationFunctionalTest method shouldAllowAccess_internal.
@Test
public void shouldAllowAccess_internal() {
// Given:
allowAccess(USER1, "POST", "/heartbeat");
// When:
final HeartbeatResponse response = makeHeartbeat(USER1);
// Then:
assertThat(response.getIsOk(), is(true));
}
Aggregations