use of io.confluent.ksql.parser.tree.ListStreams in project ksql by confluentinc.
the class KsqlParserTest method testShowStreams.
@Test
public void testShowStreams() throws Exception {
String simpleQuery = "SHOW STREAMS;";
Statement statement = KSQL_PARSER.buildAst(simpleQuery, metaStore).get(0);
Assert.assertTrue(statement instanceof ListStreams);
ListStreams listStreams = (ListStreams) statement;
Assert.assertTrue(listStreams.toString().equalsIgnoreCase("ListStreams{}"));
}
use of io.confluent.ksql.parser.tree.ListStreams 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));
}
Aggregations