Search in sources :

Example 1 with TestKsqlContext

use of io.confluent.ksql.integration.TestKsqlContext in project ksql by confluentinc.

the class KsMaterializationFunctionalTest method shouldReturnEmptyIfAppServerNotConfigured.

@Test
public void shouldReturnEmptyIfAppServerNotConfigured() {
    // Given:
    try (TestKsqlContext ksqlNoAppServer = TEST_HARNESS.ksqlContextBuilder().build()) {
        initializeKsql(ksqlNoAppServer);
        final PersistentQueryMetadata query = executeQuery(ksqlNoAppServer, "CREATE TABLE " + output + " AS" + " SELECT USERID, COUNT(*) AS COUNT FROM " + USER_TABLE + " GROUP BY USERID;");
        // When:
        final Optional<Materialization> result = query.getMaterialization(queryId, contextStacker);
        // Then:
        assertThat(result, is(Optional.empty()));
    }
}
Also used : Materialization(io.confluent.ksql.execution.streams.materialization.Materialization) TestKsqlContext(io.confluent.ksql.integration.TestKsqlContext) PersistentQueryMetadata(io.confluent.ksql.util.PersistentQueryMetadata) IntegrationTest(org.apache.kafka.test.IntegrationTest) Test(org.junit.Test)

Aggregations

Materialization (io.confluent.ksql.execution.streams.materialization.Materialization)1 TestKsqlContext (io.confluent.ksql.integration.TestKsqlContext)1 PersistentQueryMetadata (io.confluent.ksql.util.PersistentQueryMetadata)1 IntegrationTest (org.apache.kafka.test.IntegrationTest)1 Test (org.junit.Test)1