use of io.confluent.ksql.execution.ddl.commands.DropTypeCommand in project ksql by confluentinc.
the class DropTypeFactoryTest method shouldCreateDropType.
@Test
public void shouldCreateDropType() {
// Given:
final DropType dropType = new DropType(Optional.empty(), EXISTING_TYPE, false);
// When:
final DropTypeCommand cmd = factory.create(dropType);
// Then:
assertThat(cmd.getTypeName(), equalTo(EXISTING_TYPE));
}
use of io.confluent.ksql.execution.ddl.commands.DropTypeCommand in project ksql by confluentinc.
the class DropTypeFactoryTest method shouldCreateDropTypeForExistingTypeAndIfExistsSet.
@Test
public void shouldCreateDropTypeForExistingTypeAndIfExistsSet() {
// Given:
final DropType dropType = new DropType(Optional.empty(), EXISTING_TYPE, true);
// When:
final DropTypeCommand cmd = factory.create(dropType);
// Then:
assertThat(cmd.getTypeName(), equalTo(EXISTING_TYPE));
}
use of io.confluent.ksql.execution.ddl.commands.DropTypeCommand in project ksql by confluentinc.
the class CommandFactoriesTest method shouldCreateDropType.
@Test
public void shouldCreateDropType() {
// Given:
final DropType dropType = new DropType(Optional.empty(), SOME_TYPE_NAME, false);
// When:
final DropTypeCommand cmd = (DropTypeCommand) commandFactories.create("sqlExpression", dropType, SessionConfig.of(ksqlConfig, emptyMap()));
// Then:
assertThat(cmd, is(dropTypeCommand));
verify(dropTypeFactory).create(dropType);
}
use of io.confluent.ksql.execution.ddl.commands.DropTypeCommand in project ksql by confluentinc.
the class DdlCommandExecTest method setup.
@Before
public void setup() {
when(source.getName()).thenReturn(STREAM_NAME);
when(source.getDataSourceType()).thenReturn(DataSourceType.KSTREAM);
when(source.getKafkaTopicName()).thenReturn(TOPIC_NAME);
cmdExec = new DdlCommandExec(metaStore);
dropType = new DropTypeCommand("type");
registerType = new RegisterTypeCommand(type, "type");
}
use of io.confluent.ksql.execution.ddl.commands.DropTypeCommand in project ksql by confluentinc.
the class DropTypeFactoryTest method shouldNotFailCreateTypeIfTypeDoesNotExistAndIfExistsSet.
@Test
public void shouldNotFailCreateTypeIfTypeDoesNotExistAndIfExistsSet() {
// Given:
final DropType dropType = new DropType(Optional.empty(), NOT_EXISTING_TYPE, true);
// When:
final DropTypeCommand cmd = factory.create(dropType);
// Then:
assertThat(cmd.getTypeName(), equalTo(NOT_EXISTING_TYPE));
}
Aggregations