use of io.confluent.ksql.rest.entity.CommandStatusEntity in project ksql by confluentinc.
the class KsqlResourceTest method shouldCreateTableWithInference.
@Test
public void shouldCreateTableWithInference() throws Exception {
KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
final String ksqlString = "CREATE TABLE orders WITH (KAFKA_TOPIC='orders-topic', " + "VALUE_FORMAT = 'avro', KEY = 'orderid');";
Response response = testResource.handleKsqlStatements(new KsqlRequest(ksqlString, new HashMap<>()));
KsqlEntityList result = (KsqlEntityList) response.getEntity();
assertThat("Incorrect response.", result.size(), equalTo(1));
assertTrue(result.get(0) instanceof CommandStatusEntity);
CommandStatusEntity commandStatusEntity = (CommandStatusEntity) result.get(0);
assertTrue(commandStatusEntity.getCommandId().getType().name().equalsIgnoreCase("TABLE"));
}
Aggregations