Search in sources :

Example 1 with ItemDataProvider

use of io.confluent.ksql.util.ItemDataProvider in project ksql by confluentinc.

the class JoinIntTest method before.

@Before
public void before() throws Exception {
    testHarness = new IntegrationTestHarness();
    testHarness.start();
    Map<String, Object> ksqlStreamConfigProps = new HashMap<>();
    ksqlStreamConfigProps.putAll(testHarness.ksqlConfig.getKsqlStreamConfigProps());
    // turn caching off to improve join consistency
    ksqlStreamConfigProps.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0);
    ksqlStreamConfigProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");
    ksqlContext = KsqlContext.create(new KsqlConfig(ksqlStreamConfigProps), testHarness.schemaRegistryClient);
    /**
     * Setup test data
     */
    testHarness.createTopic(itemTableTopicJson);
    testHarness.createTopic(itemTableTopicAvro);
    itemDataProvider = new ItemDataProvider();
    testHarness.publishTestData(itemTableTopicJson, itemDataProvider, now - 500);
    testHarness.publishTestData(itemTableTopicAvro, itemDataProvider, now - 500, DataSource.DataSourceSerDe.AVRO);
    testHarness.createTopic(orderStreamTopicJson);
    testHarness.createTopic(orderStreamTopicAvro);
    orderDataProvider = new OrderDataProvider();
    testHarness.publishTestData(orderStreamTopicJson, orderDataProvider, now);
    testHarness.publishTestData(orderStreamTopicAvro, orderDataProvider, now, DataSource.DataSourceSerDe.AVRO);
    createStreams();
}
Also used : OrderDataProvider(io.confluent.ksql.util.OrderDataProvider) ItemDataProvider(io.confluent.ksql.util.ItemDataProvider) HashMap(java.util.HashMap) KsqlConfig(io.confluent.ksql.util.KsqlConfig) Before(org.junit.Before)

Example 2 with ItemDataProvider

use of io.confluent.ksql.util.ItemDataProvider in project ksql by confluentinc.

the class UdfIntTest method before.

@Before
public void before() throws Exception {
    testHarness = new IntegrationTestHarness();
    testHarness.start();
    ksqlContext = KsqlContext.create(testHarness.ksqlConfig, testHarness.schemaRegistryClient);
    testHarness.createTopic(jsonTopicName);
    testHarness.createTopic(avroTopicName);
    /**
     * Setup test data
     */
    orderDataProvider = new OrderDataProvider();
    itemDataProvider = new ItemDataProvider();
    jsonRecordMetadataMap = testHarness.publishTestData(jsonTopicName, orderDataProvider, null, DataSource.DataSourceSerDe.JSON);
    avroRecordMetadataMap = testHarness.publishTestData(avroTopicName, orderDataProvider, null, DataSource.DataSourceSerDe.AVRO);
    testHarness.publishTestData(delimitedTopicName, itemDataProvider, null, DataSource.DataSourceSerDe.DELIMITED);
    createOrdersStream();
}
Also used : OrderDataProvider(io.confluent.ksql.util.OrderDataProvider) ItemDataProvider(io.confluent.ksql.util.ItemDataProvider) Before(org.junit.Before)

Aggregations

ItemDataProvider (io.confluent.ksql.util.ItemDataProvider)2 OrderDataProvider (io.confluent.ksql.util.OrderDataProvider)2 Before (org.junit.Before)2 KsqlConfig (io.confluent.ksql.util.KsqlConfig)1 HashMap (java.util.HashMap)1