Search in sources :

Example 1 with SqlUndefineVariableCommand

use of io.confluent.ksql.tools.migrations.util.CommandParser.SqlUndefineVariableCommand in project ksql by confluentinc.

the class CommandParserTest method shouldParseUndefineStatement.

@Test
public void shouldParseUndefineStatement() {
    // Given:
    final String undefineVar = "UNDEFINE var;";
    // When:
    List<SqlCommand> commands = parse(undefineVar);
    // Then:
    assertThat(commands.size(), is(1));
    assertThat(commands.get(0).getCommand(), is(undefineVar));
    assertThat(commands.get(0), instanceOf(SqlUndefineVariableCommand.class));
    assertThat(((SqlUndefineVariableCommand) commands.get(0)).getVariable(), is("var"));
}
Also used : SqlUndefineVariableCommand(io.confluent.ksql.tools.migrations.util.CommandParser.SqlUndefineVariableCommand) Matchers.containsString(org.hamcrest.Matchers.containsString) SqlCommand(io.confluent.ksql.tools.migrations.util.CommandParser.SqlCommand) Test(org.junit.Test)

Aggregations

SqlCommand (io.confluent.ksql.tools.migrations.util.CommandParser.SqlCommand)1 SqlUndefineVariableCommand (io.confluent.ksql.tools.migrations.util.CommandParser.SqlUndefineVariableCommand)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1