Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8233

Helper class to make it simpler to write test logic with TopologyTestDriver

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: streams
    • Labels:

      Description

      When using TopologyTestDriver you need to call ConsumerRecordFactory to create ConsumerRecord passed into pipeInput method to write to topic. Also when calling readOutput to consume from topic, you need to provide correct Deserializers each time.

      You easily end up writing helper methods in your test classed, but this can be avoided when adding generic input and output topic classes.

      This improvement adds TestInputTopic class which wraps TopologyTestDriver  and ConsumerRecordFactory methods as one class to be used to write to Input Topics and TestOutputTopic class which collects TopologyTestDriver  reading methods and provide typesafe read methods.

       

      More info and an example of how Stream test looks after using this classes:

      https://github.com/jukkakarvanen/kafka-streams-test-topics

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jkarvanen Jukka Karvanen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: