use of io.confluent.ksql.rest.entity.FieldInfo in project ksql by confluentinc.
the class EntityUtilTest method shouldNotExposeMetaColumns.
@Test
public void shouldNotExposeMetaColumns() {
// Given:
final LogicalSchema schema = LogicalSchema.builder().valueColumn(ColumnName.of("bob"), SqlTypes.STRING).build();
// When:
final List<FieldInfo> fields = EntityUtil.buildSourceSchemaEntity(schema);
// Then:
assertThat(fields, hasSize(1));
}
use of io.confluent.ksql.rest.entity.FieldInfo in project ksql by confluentinc.
the class ConsoleTest method shouldPrintTypesList.
@Test
public void shouldPrintTypesList() {
// Given:
final KsqlEntityList entities = new KsqlEntityList(ImmutableList.of(new TypeList("statement", ImmutableMap.of("typeB", new SchemaInfo(SqlBaseType.ARRAY, null, new SchemaInfo(SqlBaseType.STRING, null, null)), "typeA", new SchemaInfo(SqlBaseType.STRUCT, ImmutableList.of(new FieldInfo("f1", new SchemaInfo(SqlBaseType.STRING, null, null), Optional.empty())), null), "typeC", new SchemaInfo(SqlBaseType.DECIMAL, null, null, ImmutableMap.of("precision", 10, "scale", 9))))));
// When:
console.printKsqlEntityList(entities);
// Then:
final String output = terminal.getOutputString();
Approvals.verify(output, approvalOptions);
}
Aggregations