Skip to content

KAFKA-19871: Add a TopologyTestDriverBuilder, deprecate old constructors#22673

Merged
mjsax merged 6 commits into
apache:trunkfrom
sebastienviale:KAFKA-19871-Multipartition-TTDriver-Add-Builder
Jul 1, 2026
Merged

KAFKA-19871: Add a TopologyTestDriverBuilder, deprecate old constructors#22673
mjsax merged 6 commits into
apache:trunkfrom
sebastienviale:KAFKA-19871-Multipartition-TTDriver-Add-Builder

Conversation

@sebastienviale

@sebastienviale sebastienviale commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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:

  • adds a builder-based API for creating TopologyTestDriver instances
  • deprecates the existing TopologyTestDriver constructors in favor of
    the builder
  • preserves the behavior of the existing constructors, which continue to
    work unchanged
  • keeps the builder functionally equivalent to the existing constructors
    for now.

Reviewers: Matthias J. Sax matthias@confluent.io, Lucas Brutschy
lbrutschy@confluent.io

@github-actions github-actions Bot added triage PRs from the community streams labels Jun 25, 2026
@mjsax mjsax added kip Requires or implements a KIP ci-approved and removed triage PRs from the community labels Jun 25, 2026

@mjsax mjsax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Made a pass.

Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
@sebastienviale

Copy link
Copy Markdown
Contributor Author

@mjsax Thanks for the feedback! I updated the PR

@lucasbru lucasbru requested a review from Copilot June 30, 2026 10:41

@lucasbru lucasbru left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lucasbru

Copy link
Copy Markdown
Member

Leave it to @mjsax to press the merge button once happy

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TopologyTestDriverBuilder with fluent configuration (withConfig, withInitialWallClockTime) and build().
  • Deprecated legacy TopologyTestDriver constructors and routed them through a shared package-private core constructor.
  • Updated TopologyTestDriverTest to 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.

Comment thread streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java Outdated
@mjsax

mjsax commented Jun 30, 2026

Copy link
Copy Markdown
Member

Build failed. Can you take a look?

@sebastienviale

Copy link
Copy Markdown
Contributor Author

CI is ok now

@mjsax mjsax merged commit 46475f4 into apache:trunk Jul 1, 2026
24 checks passed
@mjsax

mjsax commented Jul 1, 2026

Copy link
Copy Markdown
Member

Thanks for the PR. Merged to trunk.

@sebastienviale

Copy link
Copy Markdown
Contributor Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved kip Requires or implements a KIP streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants