use of io.confluent.ksql.rest.entity.SourceInfo in project ksql by confluentinc.
the class KsqlResourceTest method testListStreamsStatement.
@Test
public void testListStreamsStatement() throws Exception {
KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
final String ksqlString = "LIST STREAMS;";
final ListStreams ksqlStatement = new ListStreams(Optional.empty());
StreamsList streamsList = makeSingleRequest(testResource, ksqlString, ksqlStatement, Collections.emptyMap(), StreamsList.class);
List<SourceInfo.Stream> testStreams = streamsList.getStreams();
assertEquals(1, testStreams.size());
SourceInfo expectedStream = new SourceInfo.Stream((KsqlStream) testResource.getKsqlEngine().getMetaStore().getSource("TEST_STREAM"));
assertEquals(expectedStream, testStreams.get(0));
}
use of io.confluent.ksql.rest.entity.SourceInfo in project ksql by confluentinc.
the class KsqlResourceTest method testListTablesStatement.
@Test
public void testListTablesStatement() throws Exception {
KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
final String ksqlString = "LIST TABLES;";
final ListTables ksqlStatement = new ListTables(Optional.empty());
TablesList tablesList = makeSingleRequest(testResource, ksqlString, ksqlStatement, Collections.emptyMap(), TablesList.class);
List<SourceInfo.Table> testTables = tablesList.getTables();
assertEquals(1, testTables.size());
SourceInfo expectedTable = new SourceInfo.Table((KsqlTable) testResource.getKsqlEngine().getMetaStore().getSource("TEST_TABLE"));
assertEquals(expectedTable, testTables.get(0));
}
Aggregations