use of io.confluent.ksql.api.client.impl.ConnectorTypeImpl in project ksql by confluentinc.
the class ClientTest method shouldListConnectors.
@Test
public void shouldListConnectors() throws Exception {
// Given:
final ConnectorList entity = new ConnectorList("list connectors;", Collections.emptyList(), Collections.singletonList(new SimpleConnectorInfo("name", SOURCE_TYPE, "class", "state")));
testEndpoints.setKsqlEndpointResponse(Collections.singletonList(entity));
// When:
final List<io.confluent.ksql.api.client.ConnectorInfo> connectors = javaClient.listConnectors().get();
// Then:
assertThat(connectors.size(), is(1));
assertThat(connectors.get(0).state(), is("state"));
assertThat(connectors.get(0).name(), is("name"));
assertThat(connectors.get(0).type(), is(new ConnectorTypeImpl("SOURCE")));
}
use of io.confluent.ksql.api.client.impl.ConnectorTypeImpl in project ksql by confluentinc.
the class ClientTest method shouldDescribeConnector.
@Test
public void shouldDescribeConnector() throws Exception {
// Given:
final ConnectorDescription entity = new ConnectorDescription("describe connector;", "connectorClass", new ConnectorStateInfo("name", new ConnectorState("state", "worker", "msg"), Collections.emptyList(), SOURCE_TYPE), Collections.emptyList(), Collections.singletonList("topic"), Collections.emptyList());
testEndpoints.setKsqlEndpointResponse(Collections.singletonList(entity));
// When:
final io.confluent.ksql.api.client.ConnectorDescription connector = javaClient.describeConnector("name").get();
// Then:
assertThat(connector.state(), is("state"));
assertThat(connector.className(), is("connectorClass"));
assertThat(connector.type(), is(new ConnectorTypeImpl("SOURCE")));
assertThat(connector.sources().size(), is(0));
assertThat(connector.topics().size(), is(1));
assertThat(connector.topics().get(0), is("topic"));
}
Aggregations