use of io.confluent.ksql.execution.streams.StreamsFactories in project ksql by confluentinc.
the class SchemaKTableTest method init.
@Before
public void init() {
UserFunctionLoader.newInstance(ksqlConfig, functionRegistry, ".", new Metrics()).load();
schemaResolver = new StepSchemaResolver(ksqlConfig, functionRegistry);
ksqlTable = (KsqlTable) metaStore.getSource(SourceName.of("TEST2"));
final StreamsBuilder builder = new StreamsBuilder();
kTable = builder.table(ksqlTable.getKsqlTopic().getKafkaTopicName(), Consumed.with(Serdes.String(), getRowSerde(ksqlTable.getKsqlTopic(), ksqlTable.getSchema())));
secondKsqlTable = (KsqlTable) metaStore.getSource(SourceName.of("TEST3"));
secondKTable = builder.table(secondKsqlTable.getKsqlTopic().getKafkaTopicName(), Consumed.with(Serdes.String(), getRowSerde(secondKsqlTable.getKsqlTopic(), secondKsqlTable.getSchema())));
mockKTable = mock(KTable.class);
firstSchemaKTable = buildSchemaKTableForJoin(ksqlTable, mockKTable);
secondSchemaKTable = buildSchemaKTableForJoin(secondKsqlTable, secondKTable);
when(executeContext.getKsqlConfig()).thenReturn(ksqlConfig);
when(executeContext.getFunctionRegistry()).thenReturn(functionRegistry);
when(executeContext.getProcessingLogger(any())).thenReturn(processingLogger);
planBuilder = new KSPlanBuilder(executeContext, mock(SqlPredicateFactory.class), mock(AggregateParamsFactory.class), new StreamsFactories(groupedFactory, mock(JoinedFactory.class), mock(MaterializedFactory.class), mock(StreamJoinedFactory.class), mock(ConsumedFactory.class)));
}
Aggregations