use of io.confluent.ksql.schema.query.QuerySchemas in project ksql by confluentinc.
the class QueryDescriptionFactoryTest method setUp.
@Before
public void setUp() {
when(topology.describe()).thenReturn(topologyDescription);
when(kafkaStreamsBuilder.build(any(), any())).thenReturn(queryStreams);
when(queryStreams.metadataForLocalThreads()).thenReturn(Collections.emptySet());
when(sinkTopic.getKeyFormat()).thenReturn(KeyFormat.nonWindowed(FormatInfo.of(FormatFactory.KAFKA.name()), SerdeFeatures.of()));
when(sinkDataSource.getKsqlTopic()).thenReturn(sinkTopic);
when(sinkDataSource.getName()).thenReturn(SourceName.of("sink name"));
transientQuery = new TransientQueryMetadata(SQL_TEXT, TRANSIENT_SCHEMA, SOURCE_NAMES, "execution plan", queryQueue, QUERY_ID, APPLICATION_ID, topology, kafkaStreamsBuilder, STREAMS_PROPS, PROP_OVERRIDES, closeTimeout, 10, ResultType.STREAM, 0L, 0L, listener);
transientQuery.initialize();
transientQueryDescription = QueryDescriptionFactory.forQueryMetadata(transientQuery, Collections.emptyMap());
persistentQuery = new PersistentQueryMetadataImpl(KsqlConstants.PersistentQueryType.CREATE_AS, SQL_TEXT, PhysicalSchema.from(PERSISTENT_SCHEMA, SerdeFeatures.of(), SerdeFeatures.of()), SOURCE_NAMES, Optional.of(sinkDataSource), "execution plan", QUERY_ID, Optional.empty(), APPLICATION_ID, topology, kafkaStreamsBuilder, new QuerySchemas(), STREAMS_PROPS, PROP_OVERRIDES, closeTimeout, QueryErrorClassifier.DEFAULT_CLASSIFIER, physicalPlan, 10, processingLogger, 0L, 0L, listener, Optional.empty());
persistentQuery.initialize();
persistentQueryDescription = QueryDescriptionFactory.forQueryMetadata(persistentQuery, STATUS_MAP);
}
Aggregations