Search in sources :

Example 6 with AlterSource

use of io.confluent.ksql.parser.tree.AlterSource in project ksql by confluentinc.

the class AlterSourceFactoryTest method shouldCreateCommandForAlterStream.

@Test
public void shouldCreateCommandForAlterStream() {
    // Given:
    final AlterSource alterSource = new AlterSource(STREAM_NAME, DataSourceType.KSTREAM, NEW_COLUMNS);
    // When:
    final AlterSourceCommand result = alterSourceFactory.create(alterSource);
    // Then:
    assertEquals(result.getKsqlType(), DataSourceType.KSTREAM.getKsqlType());
    assertEquals(result.getSourceName(), STREAM_NAME);
    assertEquals(result.getNewColumns().size(), 1);
}
Also used : AlterSource(io.confluent.ksql.parser.tree.AlterSource) AlterSourceCommand(io.confluent.ksql.execution.ddl.commands.AlterSourceCommand) Test(org.junit.Test)

Aggregations

AlterSource (io.confluent.ksql.parser.tree.AlterSource)6 Test (org.junit.Test)5 AlterSourceCommand (io.confluent.ksql.execution.ddl.commands.AlterSourceCommand)3 KsqlException (io.confluent.ksql.util.KsqlException)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 DdlCommand (io.confluent.ksql.execution.ddl.commands.DdlCommand)1 MetaStore (io.confluent.ksql.metastore.MetaStore)1 DataSource (io.confluent.ksql.metastore.model.DataSource)1 ColumnName (io.confluent.ksql.name.ColumnName)1 Column (io.confluent.ksql.schema.ksql.Column)1 Namespace (io.confluent.ksql.schema.ksql.Column.Namespace)1 List (java.util.List)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 Collectors (java.util.stream.Collectors)1