use of io.confluent.ksql.rest.entity.SimpleConnectorInfo in project ksql by confluentinc.
the class ListConnectorsExecutorTest method shouldListInvalidConnectorWithNoInfo.
@Test
public void shouldListInvalidConnectorWithNoInfo() {
// Given:
when(connectClient.connectors()).thenReturn(ConnectResponse.success(ImmutableList.of("connector2"), HttpStatus.SC_OK));
final ConfiguredStatement<ListConnectors> statement = ConfiguredStatement.of(PreparedStatement.of("", new ListConnectors(Optional.empty(), Scope.ALL)), SessionConfig.of(new KsqlConfig(ImmutableMap.of()), ImmutableMap.of()));
// When:
final Optional<KsqlEntity> entity = EXECUTOR.execute(statement, mock(SessionProperties.class), engine, serviceContext).getEntity();
// Then:
assertThat("expected response!", entity.isPresent());
final ConnectorList connectorList = (ConnectorList) entity.get();
assertThat(connectorList, is(new ConnectorList("", ImmutableList.of(new KsqlWarning("Could not describe connector connector2: DANGER WILL ROBINSON.")), ImmutableList.of(new SimpleConnectorInfo("connector2", ConnectorType.UNKNOWN, null, null)))));
}
Aggregations