Search in sources :

Example 1 with ServerClusterId

use of io.confluent.ksql.rest.entity.ServerClusterId in project ksql by confluentinc.

the class RestApiTest method shouldExecuteServerMetadataIdRequest.

@Test
public void shouldExecuteServerMetadataIdRequest() {
    // When:
    final ServerClusterId response = RestIntegrationTestUtil.makeServerMetadataIdRequest(REST_APP);
    // Then:
    assertThat(response, is(notNullValue()));
}
Also used : ServerClusterId(io.confluent.ksql.rest.entity.ServerClusterId) Test(org.junit.Test) IntegrationTest(io.confluent.common.utils.IntegrationTest)

Example 2 with ServerClusterId

use of io.confluent.ksql.rest.entity.ServerClusterId in project ksql by confluentinc.

the class RestIntegrationTestUtil method makeServerMetadataIdRequest.

static ServerClusterId makeServerMetadataIdRequest(final TestKsqlRestApp restApp) {
    try (final KsqlRestClient restClient = restApp.buildKsqlClient(Optional.empty())) {
        final RestResponse<ServerClusterId> res = restClient.getServerMetadataId();
        throwOnError(res);
        return res.getResponse();
    }
}
Also used : KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) ServerClusterId(io.confluent.ksql.rest.entity.ServerClusterId)

Example 3 with ServerClusterId

use of io.confluent.ksql.rest.entity.ServerClusterId in project ksql by confluentinc.

the class TestEndpoints method executeServerMetadataClusterId.

@Override
public synchronized CompletableFuture<EndpointResponse> executeServerMetadataClusterId(ApiSecurityContext apiSecurityContext) {
    this.lastApiSecurityContext = apiSecurityContext;
    final ServerClusterId entity = ServerClusterId.of("kafka-cluster-id", "ksql-service-id");
    return CompletableFuture.completedFuture(EndpointResponse.ok(entity));
}
Also used : ServerClusterId(io.confluent.ksql.rest.entity.ServerClusterId)

Example 4 with ServerClusterId

use of io.confluent.ksql.rest.entity.ServerClusterId in project ksql by confluentinc.

the class ServerMetadataResourceTest method shouldReturnServerClusterId.

@Test
public void shouldReturnServerClusterId() {
    // When:
    final EndpointResponse response = serverMetadataResource.getServerClusterId();
    // Then:
    assertThat(response.getStatus(), equalTo(200));
    assertThat(response.getEntity(), instanceOf(ServerClusterId.class));
    final ServerClusterId serverClusterId = (ServerClusterId) response.getEntity();
    assertThat(serverClusterId, equalTo(ServerClusterId.of(KAFKA_CLUSTER_ID, KSQL_SERVICE_ID)));
}
Also used : EndpointResponse(io.confluent.ksql.rest.EndpointResponse) ServerClusterId(io.confluent.ksql.rest.entity.ServerClusterId) Test(org.junit.Test)

Aggregations

ServerClusterId (io.confluent.ksql.rest.entity.ServerClusterId)4 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