Current state: Accepted
Discussion thread: here
For many use cases of TopologyTestDriver, we don't need to specify properties parameter. As of https://github.com/apache/kafka/pull/9477, many TopologyTestDriver usages will have no configurations at all to specify, so we should provide a constructor that doesn't take a Properties argument. Right now, such configuration-free usages have to provide an empty Properties object.
There can be other use cases where we would like to specify initial clock time without specifying properties. So we can have another constructor which takes in parameter of initial clock time along with topology parameter.
Application-id set by default should be randomized so that no two tests can interfere with each other.
We propose to add new constructor to TopologyTestDriver class. This constructor will have only Topology as parameter. Kafka streams config has APPLICATION_ID_CONFIG and BOOTSTRAP_SERVERS_CONFIG as required parameters. Those values will be provided in the private constructor of TopologyTestDriver. We want to set randomized application id to avoid conflicts with tests running in parallel. Proposing to change private constructor of TopologyTestDriver in following way.
Classes which will have usage for this constructor are
Compatibility, Deprecation, and Migration Plan
The proposal is backward-compatible because it only adds a new constructor and does not change any existing constructors/methods. All changes will affect test classes and will get rid of redundant properties parameter.
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.