KAFKA-19871: Add a TopologyTestDriverBuilder, deprecate old constructors#22673
Conversation
mjsax
left a comment
There was a problem hiding this comment.
Thanks for the PR. Made a pass.
|
@mjsax Thanks for the feedback! I updated the PR |
|
Leave it to @mjsax to press the merge button once happy |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new TopologyTestDriverBuilder API in streams/test-utils as the preferred entry point for constructing TopologyTestDriver instances, while deprecating the existing public constructors to enable future configuration extensions (eg, multi-partition testing per KIP-1238).
Changes:
- Added
TopologyTestDriverBuilderwith fluent configuration (withConfig,withInitialWallClockTime) andbuild(). - Deprecated legacy
TopologyTestDriverconstructors and routed them through a shared package-private core constructor. - Updated
TopologyTestDriverTestto use the new builder API instead of deprecated constructors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| streams/test-utils/src/test/java/org/apache/kafka/streams/TopologyTestDriverTest.java | Migrates tests to construct drivers via TopologyTestDriverBuilder. |
| streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriverBuilder.java | Adds the new builder API for configuring and creating TopologyTestDriver. |
| streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java | Deprecates legacy constructors, exposes a package-private core constructor for the builder, and updates output TestRecord creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Build failed. Can you take a look? |
|
CI is ok now |
|
Thanks for the PR. Merged to |
|
thanks |
As part of KIP-1238, we are introducing a new TopologyTestDriverBuilder
API for configuring TopologyTestDriver.
This PR is intentionally limited to introducing the builder
infrastructure and deprecating the legacy constructors. Follow-up PRs
will use the builder to add support for multi-partition testing and
other configuration options.
This PR introduces TopologyTestDriverBuilder and:
the builder
work unchanged
for now.
Reviewers: Matthias J. Sax matthias@confluent.io, Lucas Brutschy
lbrutschy@confluent.io