Bird
0
0

How do you instantiate a TopologyTestDriver in Java for a given topology and properties?

easy📝 Syntax Q3 of 15
Kafka - Advanced Stream Processing
How do you instantiate a TopologyTestDriver in Java for a given topology and properties?
Anew TopologyTestDriver(props, topology);
BTopologyTestDriver.create(topology, props);
CTopologyTestDriver.build(topology, props);
Dnew TopologyTestDriver(topology, props);
Step-by-Step Solution
Solution:
  1. Step 1: Recall constructor signature

    The TopologyTestDriver is instantiated using its constructor with parameters: topology and properties.
  2. Step 2: Analyze options

    new TopologyTestDriver(topology, props); matches the correct constructor call. Options B and C use non-existent static methods. new TopologyTestDriver(props, topology); reverses the parameter order, which is incorrect.
  3. Final Answer:

    new TopologyTestDriver(topology, props); -> Option D
  4. Quick Check:

    Constructor with (topology, props) [OK]
Quick Trick: Use constructor with topology and props [OK]
Common Mistakes:
MISTAKES
  • Using static factory methods that don't exist
  • Swapping parameter order
  • Omitting required arguments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes