use of io.confluent.ksql.execution.context.QueryContext in project ksql by confluentinc.
the class StreamTableJoinBuilderTest method shouldBuildLeftSerdeCorrectly.
@Test
public void shouldBuildLeftSerdeCorrectly() {
// Given:
givenInnerJoin(SYNTH_KEY);
// When:
join.build(planBuilder, planInfo);
// Then:
final QueryContext leftCtx = QueryContext.Stacker.of(CTX).push("Left").getQueryContext();
verify(buildContext).buildValueSerde(FormatInfo.of(FormatFactory.JSON.name()), LEFT_PHYSICAL, leftCtx);
}
use of io.confluent.ksql.execution.context.QueryContext in project ksql by confluentinc.
the class StreamAggregateBuilderTest method shouldReturnCorrectSerdeForWindowedAggregate.
@Test
public void shouldReturnCorrectSerdeForWindowedAggregate() {
for (final Runnable given : given()) {
// Given:
clearInvocations(groupedStream, timeWindowedStream, sessionWindowedStream, aggregated, buildContext);
given.run();
// When:
final KTableHolder<Windowed<GenericKey>> tableHolder = windowedAggregate.build(planBuilder, planInfo);
// Then:
final ExecutionKeyFactory<Windowed<GenericKey>> serdeFactory = tableHolder.getExecutionKeyFactory();
final FormatInfo mockFormat = mock(FormatInfo.class);
final PhysicalSchema mockSchema = mock(PhysicalSchema.class);
final QueryContext mockCtx = mock(QueryContext.class);
serdeFactory.buildKeySerde(mockFormat, mockSchema, mockCtx);
verify(buildContext).buildKeySerde(same(mockFormat), eq(windowedAggregate.getWindowExpression().getWindowInfo()), same(mockSchema), same(mockCtx));
}
}
Aggregations