use of io.confluent.ksql.rest.entity.ServerMetadata in project ksql by confluentinc.
the class RestApiTest method shouldExecuteServerMetadataRequest.
@Test
public void shouldExecuteServerMetadataRequest() {
// When:
final ServerMetadata response = RestIntegrationTestUtil.makeServerMetadataRequest(REST_APP);
// Then:
assertThat(response.getVersion(), is(notNullValue()));
assertThat(response.getClusterId(), is(notNullValue()));
}
use of io.confluent.ksql.rest.entity.ServerMetadata in project ksql by confluentinc.
the class RestIntegrationTestUtil method makeServerMetadataRequest.
static ServerMetadata makeServerMetadataRequest(final TestKsqlRestApp restApp) {
try (final KsqlRestClient restClient = restApp.buildKsqlClient(Optional.empty())) {
final RestResponse<ServerMetadata> res = restClient.getServerMetadata();
throwOnError(res);
return res.getResponse();
}
}
use of io.confluent.ksql.rest.entity.ServerMetadata in project ksql by confluentinc.
the class ServerMetadataResourceTest method shouldReturnServerMetadata.
@Test
public void shouldReturnServerMetadata() {
// When:
final EndpointResponse response = serverMetadataResource.getServerMetadata();
// Then:
assertThat(response.getStatus(), equalTo(200));
assertThat(response.getEntity(), instanceOf(ServerMetadata.class));
final ServerMetadata serverMetadata = (ServerMetadata) response.getEntity();
assertThat(serverMetadata, equalTo(new ServerMetadata(AppInfo.getVersion(), ServerClusterId.of(KAFKA_CLUSTER_ID, KSQL_SERVICE_ID))));
}
Aggregations