Search in sources :

Example 1 with StubKafkaClientSupplier

use of io.confluent.ksql.test.tools.stubs.StubKafkaClientSupplier in project ksql by confluentinc.

the class TestExecutor method create.

/**
 * Create instance.
 *
 * <p>If {@code validateResults} is {@code true} the test will fail if the results are as
 * expected. This is the norm. If {@code false} the test will not fail if the results differ. This
 * is useful when re-writing the historical plans.
 *
 * @param validateResults flag to indicate if results should be validated.
 * @param extensionDir Optional extension directory.
 * @return the executor.
 */
public static TestExecutor create(final boolean validateResults, final Optional<String> extensionDir) {
    final StubKafkaService kafkaService = StubKafkaService.create();
    final StubKafkaClientSupplier kafkaClientSupplier = new StubKafkaClientSupplier();
    final ServiceContext serviceContext = getServiceContext(kafkaClientSupplier);
    return new TestExecutor(kafkaService, serviceContext, getKsqlEngine(serviceContext, extensionDir), TestExecutorUtil::buildStreamsTopologyTestDrivers, validateResults);
}
Also used : StubKafkaService(io.confluent.ksql.test.tools.stubs.StubKafkaService) ServiceContext(io.confluent.ksql.services.ServiceContext) DefaultServiceContext(io.confluent.ksql.services.DefaultServiceContext) StubKafkaClientSupplier(io.confluent.ksql.test.tools.stubs.StubKafkaClientSupplier)

Aggregations

DefaultServiceContext (io.confluent.ksql.services.DefaultServiceContext)1 ServiceContext (io.confluent.ksql.services.ServiceContext)1 StubKafkaClientSupplier (io.confluent.ksql.test.tools.stubs.StubKafkaClientSupplier)1 StubKafkaService (io.confluent.ksql.test.tools.stubs.StubKafkaService)1