Skip to content

KAFKA-20692: Add unit tests for ToolsUtils#22577

Open
Dpk376 wants to merge 1 commit into
apache:trunkfrom
Dpk376:KAFKA-20692-add-unit-tests-tools-utils
Open

KAFKA-20692: Add unit tests for ToolsUtils#22577
Dpk376 wants to merge 1 commit into
apache:trunkfrom
Dpk376:KAFKA-20692-add-unit-tests-tools-utils

Conversation

@Dpk376

@Dpk376 Dpk376 commented Jun 15, 2026

Copy link
Copy Markdown

Summary

`ToolsUtils` in the `tools` module contains five public methods (`printMetrics`, `prettyPrintTable`, `validateBootstrapServer`, `duplicates`, `minus`) with no corresponding unit tests. This PR adds `ToolsUtilsTest.java` covering:

  • `validateBootstrapServer` — valid single host, valid CSV hosts, null/empty/blank/no-port/mixed-invalid all throw `IllegalArgumentException`
  • `duplicates` — no dupes, single dup, multiple dups, empty list, all-same
  • `minus` — removes present elements, ignores absent, empty set, no-args copy, does not mutate original
  • `prettyPrintTable` — headers present in output, rows present, column widths aligned to max value length

All tests are pure unit tests (no cluster required).

JIRA

https://issues.apache.org/jira/browse/KAFKA-20692

@github-actions github-actions Bot added triage PRs from the community tools tests Test fixes (including flaky tests) labels Jun 15, 2026
@Dpk376

Dpk376 commented Jun 22, 2026

Copy link
Copy Markdown
Author

@chia7712 when you have a moment — KAFKA-20692 adds unit tests for ToolsUtils. It looks like the CI workflow is awaiting approval to run; would you mind approving it and taking a look? Thanks!

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

Labels

tests Test fixes (including flaky tests) tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant