Search in sources :

Example 11 with ConnectorList

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

the class CliTest method shouldIssueCCloudConnectorRequest.

@Test
public void shouldIssueCCloudConnectorRequest() throws Exception {
    // Given:
    final KsqlRestClient mockRestClient = givenMockRestClient();
    when(mockRestClient.getIsCCloudServer()).thenReturn(true);
    when(mockRestClient.getHasCCloudApiKey()).thenReturn(true);
    when(mockRestClient.makeConnectorRequest(anyString(), anyLong())).thenReturn(RestResponse.successful(OK.code(), new KsqlEntityList(Collections.singletonList(new ConnectorList("list connectors;", Collections.emptyList(), Collections.emptyList())))));
    // When:
    localCli.handleLine("list connectors;");
    // Then:
    verify(mockRestClient).makeConnectorRequest(anyString(), anyLong());
}
Also used : KsqlEntityList(io.confluent.ksql.rest.entity.KsqlEntityList) KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) ConnectorList(io.confluent.ksql.rest.entity.ConnectorList) Test(org.junit.Test) IntegrationTest(io.confluent.common.utils.IntegrationTest)

Aggregations

ConnectorList (io.confluent.ksql.rest.entity.ConnectorList)11 Test (org.junit.Test)9 SimpleConnectorInfo (io.confluent.ksql.rest.entity.SimpleConnectorInfo)6 ListConnectors (io.confluent.ksql.parser.tree.ListConnectors)5 KsqlEntity (io.confluent.ksql.rest.entity.KsqlEntity)5 KsqlConfig (io.confluent.ksql.util.KsqlConfig)4 KsqlEntityList (io.confluent.ksql.rest.entity.KsqlEntityList)3 IntegrationTest (io.confluent.common.utils.IntegrationTest)2 BaseApiTest (io.confluent.ksql.api.BaseApiTest)2 KsqlRestClient (io.confluent.ksql.rest.client.KsqlRestClient)2 KsqlWarning (io.confluent.ksql.rest.entity.KsqlWarning)2 ConnectorInfo (org.apache.kafka.connect.runtime.rest.entities.ConnectorInfo)2 KsqlExecutionContext (io.confluent.ksql.KsqlExecutionContext)1 KsqlClientException (io.confluent.ksql.api.client.exception.KsqlClientException)1 KsqlException (io.confluent.ksql.api.client.exception.KsqlException)1 ConnectorTypeImpl (io.confluent.ksql.api.client.impl.ConnectorTypeImpl)1 KsqlApiException (io.confluent.ksql.api.server.KsqlApiException)1 KafkaResponseGetFailedException (io.confluent.ksql.exception.KafkaResponseGetFailedException)1 ParseFailedException (io.confluent.ksql.parser.exception.ParseFailedException)1 Scope (io.confluent.ksql.parser.tree.ListConnectors.Scope)1