Search in sources :

Example 1 with SqlDropConnectorStatement

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

the class CommandParserTest method shouldParseDropConnectorStatement.

@Test
public void shouldParseDropConnectorStatement() {
    // Given:
    // The space at the end is to make sure that the regex doesn't capture it as a part of the name
    final String dropConnector = "DRoP CONNEcTOR `jdbc-connector` ;";
    // When:
    List<SqlCommand> commands = parse(dropConnector);
    // Then:
    assertThat(commands.size(), is(1));
    assertThat(commands.get(0).getCommand(), is(dropConnector));
    assertThat(commands.get(0), instanceOf(SqlDropConnectorStatement.class));
    assertThat(commands.get(0).getCommand(), is(dropConnector));
    assertThat(((SqlDropConnectorStatement) commands.get(0)).getName(), is("`jdbc-connector`"));
}
Also used : SqlDropConnectorStatement(io.confluent.ksql.tools.migrations.util.CommandParser.SqlDropConnectorStatement) 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 SqlDropConnectorStatement (io.confluent.ksql.tools.migrations.util.CommandParser.SqlDropConnectorStatement)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1