use of io.confluent.ksql.parser.tree.BooleanLiteral in project ksql by confluentinc.
the class ProjectNodeTest method shouldThrowKsqlExcptionIfSchemaSizeDoesntMatchProjection.
@Test(expected = KsqlException.class)
public void shouldThrowKsqlExcptionIfSchemaSizeDoesntMatchProjection() {
mockSourceNode();
EasyMock.replay(source, stream);
final ProjectNode node = new ProjectNode(new PlanNodeId("1"), source, SchemaBuilder.struct().field("field1", Schema.STRING_SCHEMA).field("field2", Schema.STRING_SCHEMA).build(), Collections.singletonList(new BooleanLiteral("true")));
node.buildStream(builder, ksqlConfig, kafkaTopicClient, functionRegistry, props, new MockSchemaRegistryClient());
}
use of io.confluent.ksql.parser.tree.BooleanLiteral in project ksql by confluentinc.
the class ProjectNodeTest method shouldCreateProjectionWithFieldNameExpressionPairs.
@Test
public void shouldCreateProjectionWithFieldNameExpressionPairs() {
mockSourceNode();
final BooleanLiteral trueExpression = new BooleanLiteral("true");
final BooleanLiteral falseExpression = new BooleanLiteral("false");
EasyMock.expect(stream.select(Arrays.asList(new Pair<>("field1", trueExpression), new Pair<>("field2", falseExpression)))).andReturn(stream);
EasyMock.replay(source, stream);
final ProjectNode node = new ProjectNode(new PlanNodeId("1"), source, SchemaBuilder.struct().field("field1", Schema.STRING_SCHEMA).field("field2", Schema.STRING_SCHEMA).build(), Arrays.asList(trueExpression, falseExpression));
node.buildStream(builder, ksqlConfig, kafkaTopicClient, functionRegistry, props, new MockSchemaRegistryClient());
EasyMock.verify(stream);
}
Aggregations