Bird
0
0

You want to test a Kafka Streams topology that filters out records with null values before forwarding. Which approach correctly verifies this behavior using TopologyTestDriver?

hard📝 Application Q15 of 15
Kafka - Advanced Stream Processing
You want to test a Kafka Streams topology that filters out records with null values before forwarding. Which approach correctly verifies this behavior using TopologyTestDriver?
ASend records with null values and expect an exception from TopologyTestDriver
BSend only null values to input topic and expect output topic to have the same null values
CSend records with null values and check that output topic is empty without reading
DSend records with null and non-null values to input topic, then assert output topic only has non-null values
Step-by-Step Solution
Solution:
  1. Step 1: Prepare test input with null and non-null values

    This tests the filter logic by including both cases.
  2. Step 2: Verify output topic contents

    Assert that only records with non-null values appear in the output topic.
  3. Final Answer:

    Send records with null and non-null values to input topic, then assert output topic only has non-null values -> Option D
  4. Quick Check:

    Filter test = input mixed, output filtered [OK]
Quick Trick: Test filters by sending mixed input, check filtered output [OK]
Common Mistakes:
  • Expecting null values to appear in output
  • Not reading output topic to verify results
  • Assuming exceptions occur on null values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes