use of io.confluent.ksql.parser.tree.ListConnectorPlugins in project ksql by confluentinc.
the class SqlFormatterTest method shouldFormatShowConnectorPlugins.
@Test
public void shouldFormatShowConnectorPlugins() {
// Given:
final ListConnectorPlugins listConnectorPlugins = new ListConnectorPlugins(Optional.empty());
// When:
final String formatted = SqlFormatter.formatSql(listConnectorPlugins);
// Then:
assertThat(formatted, is("SHOW CONNECTOR PLUGINS"));
}
use of io.confluent.ksql.parser.tree.ListConnectorPlugins in project ksql by confluentinc.
the class ListConnectorPluginsTest method shouldListValidConnectorPlugins.
@Test
public void shouldListValidConnectorPlugins() {
// Given:
when(connectClient.connectorPlugins()).thenReturn(ConnectClient.ConnectResponse.success(ImmutableList.of(INFO), HttpStatus.SC_OK));
final KsqlConfig ksqlConfig = new KsqlConfig(ImmutableMap.of());
final ConfiguredStatement<ListConnectorPlugins> statement = ConfiguredStatement.of(KsqlParser.PreparedStatement.of("", new ListConnectorPlugins(Optional.empty())), SessionConfig.of(ksqlConfig, ImmutableMap.of()));
// When:
final Optional<KsqlEntity> entity = EXECUTOR.execute(statement, mock(SessionProperties.class), engine, serviceContext).getEntity();
// Then:
assertThat("expected response!", entity.isPresent());
final ConnectorPluginsList connectorPluginsList = (ConnectorPluginsList) entity.get();
assertThat(connectorPluginsList, is(new ConnectorPluginsList("", ImmutableList.of(), ImmutableList.of(new SimpleConnectorPluginInfo("org.apache.kafka.connect.file.FileStreamSinkConnector", ConnectorType.SOURCE, "2.1")))));
}
Aggregations