예제 #1
0
  @Test
  public void should_fail_if_table_name_is_a_reserved_keyword() throws Exception {
    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("The table name 'add' is not allowed because it is a reserved keyword");

    SchemaBuilder.dropTable("add").build();
  }
예제 #2
0
  @Test
  public void should_drop_table_with_keyspace_if_exists() throws Exception {
    // When
    final String built = SchemaBuilder.dropTable("ks", "test").ifExists(true).build();

    // Then
    assertThat(built).isEqualTo("DROP TABLE IF EXISTS ks.test");
  }
예제 #3
0
  @Test
  public void should_drop_table() throws Exception {
    // When
    final String built = SchemaBuilder.dropTable("test").build();

    // Then
    assertThat(built).isEqualTo("DROP TABLE test");
  }