fvaleri commented on a change in pull request #205: URL: https://github.com/apache/camel-kafka-connector/pull/205#discussion_r422904391
########## File path: core/src/test/java/org/apache/camel/kafkaconnector/CamelSourceTaskTest.java ########## @@ -32,270 +31,239 @@ public class CamelSourceTaskTest { + private static final String DIRECT_URI = "direct:start"; + private static final String TOPIC_NAME = "my-topic"; + + private void sendBatchOfRecords(CamelSourceTask sourceTask, long size) { + final ProducerTemplate template = sourceTask.getCms().createProducerTemplate(); + for (int i = 0; i < size; i++) { + template.sendBody(DIRECT_URI, "test" + i); + } + } + @Test public void testSourcePolling() { + final long size = 2; Map<String, String> props = new HashMap<>(); - props.put("camel.source.url", "direct:start"); - props.put("topics", "mytopic"); + props.put(CamelSourceConnectorConfig.TOPIC_CONF, TOPIC_NAME); + props.put(CamelSourceConnectorConfig.CAMEL_SOURCE_URL_CONF, DIRECT_URI); - CamelSourceTask camelSourceTask = new CamelSourceTask(); - camelSourceTask.start(props); + CamelSourceTask sourceTask = new CamelSourceTask(); Review comment: It's part of the refactoring, we have only CamelSourceTask, so it's redundant. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org