use of io.confluent.ksql.util.UserDataProvider in project ksql by confluentinc.
the class EndToEndIntegrationTest method before.
@Before
public void before() throws Exception {
testHarness = new IntegrationTestHarness();
testHarness.start();
Map<String, Object> streamsConfig = testHarness.ksqlConfig.getKsqlStreamConfigProps();
streamsConfig.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
KsqlConfig ksqlconfig = new KsqlConfig(streamsConfig);
AdminClient adminClient = AdminClient.create(ksqlconfig.getKsqlAdminClientConfigProps());
KafkaTopicClient topicClient = new KafkaTopicClientImpl(adminClient);
ksqlEngine = new KsqlEngine(ksqlconfig, topicClient);
testHarness.createTopic(pageViewTopic);
testHarness.createTopic(usersTopic);
pageViewDataProvider = new PageViewDataProvider();
testHarness.publishTestData(usersTopic, new UserDataProvider(), System.currentTimeMillis() - 10000);
testHarness.publishTestData(pageViewTopic, pageViewDataProvider, System.currentTimeMillis());
ksqlEngine.buildMultipleQueries(format("CREATE TABLE %s (registertime bigint, gender varchar, regionid varchar, " + "userid varchar) WITH (kafka_topic='%s', value_format='JSON', key = 'userid');", userTable, usersTopic), Collections.emptyMap());
ksqlEngine.buildMultipleQueries(format("CREATE STREAM %s (viewtime bigint, userid varchar, pageid varchar) " + "WITH (kafka_topic='%s', value_format='JSON');", pageViewStream, pageViewTopic), Collections.emptyMap());
}
Aggregations