Search in sources :

Example 1 with ServerMetadata

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()));
}
Also used : ServerMetadata(io.confluent.ksql.rest.entity.ServerMetadata) Test(org.junit.Test) IntegrationTest(io.confluent.common.utils.IntegrationTest)

Example 2 with ServerMetadata

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();
    }
}
Also used : KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) ServerMetadata(io.confluent.ksql.rest.entity.ServerMetadata)

Example 3 with ServerMetadata

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))));
}
Also used : EndpointResponse(io.confluent.ksql.rest.EndpointResponse) ServerMetadata(io.confluent.ksql.rest.entity.ServerMetadata) Test(org.junit.Test)

Aggregations

ServerMetadata (io.confluent.ksql.rest.entity.ServerMetadata)3 Test (org.junit.Test)2 IntegrationTest (io.confluent.common.utils.IntegrationTest)1 EndpointResponse (io.confluent.ksql.rest.EndpointResponse)1 KsqlRestClient (io.confluent.ksql.rest.client.KsqlRestClient)1