AkashGiri-Ksolves opened a new pull request, #24251:
URL: https://github.com/apache/kafka/pull/24251
Adds `ToolsUtilsTest.java` to cover the previously untested public methods
of `ToolsUtils` in the tools module, addressing the test-coverage gap described
in KAFKA-20692.
The following public methods are now covered with both positive and
negative
cases:
- `printMetrics` — verifies metrics are printed in alphabetical order
under the header, that `Double` values are formatted to three decimals and
non-`Double` values use the default format, and that null/empty input prints
nothing.
- `prettyPrintTable` — verifies header and row contents,
header-before-rows ordering, and that each column is padded to the width of its
widest value.
- `validateBootstrapServer` — verifies valid single/multiple host:port
inputs pass, and that null, empty, blank, missing-port, and partially-invalid
inputs throw `IllegalArgumentException`.
- `duplicates` — verifies duplicate detection, the no-duplicate case, and
the empty-list case.
- `minus` — verifies element removal, absent-element handling, the no-arg
copy, and that the source set is not mutated.
**Testing:** these are pure unit tests requiring no cluster.
`./gradlew :tools:test --tests "org.apache.kafka.tools.ToolsUtilsTest"`
passes (9 tests) and `:tools:checkstyleTest` is clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]