Unit testing Kafka connector with Confluent.

1,285 views
Skip to first unread message

Tushar Sudhakar Jee

unread,
Jul 10, 2017, 9:58:29 AM7/10/17
to Confluent Platform
Hi,
I wrote a kafka sink connector for an inhouse data store and need to carry out Unit testing to fulfill the requirements stated in the Partner development guide(https://www.confluent.io/wp-content/uploads/Partner-Dev-Guide-for-Kafka-Connect.pdf).
Thus, I would request kindly clarification on the expected setup/procedure in a case like this?

Thanks,
Tushar

Ewen Cheslack-Postava

unread,
Jul 20, 2017, 7:25:39 PM7/20/17
to Confluent Platform
This isn't really any different from how you'd unit test any other code -- create an instance of your connector/task, setup any mocks you need, and then exercise various scenarios. If you want some examples, check any of the Confluent connector repositories, e.g. here are the tests for the Elasticsearch connector: https://github.com/confluentinc/kafka-connect-elasticsearch/tree/master/src/test/java/io/confluent/connect/elasticsearch. Aside from getting good coverage of the body of the code, it's worth trying to test various scenarios & configs. For example, we have unit tests in the HDFS and S3 connectors covering the different configs we have for how to decide when to close and commit a file.

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/2d6ded71-6f05-4cc4-b288-f7ad724c7017%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages