mjsax commented on code in PR #20293:
URL: https://github.com/apache/kafka/pull/20293#discussion_r2404155565
##########
tools/src/test/java/org/apache/kafka/tools/streams/DescribeStreamsGroupTest.java:
##########
@@ -290,8 +291,14 @@ private StreamsGroupCommand.StreamsGroupService
getStreamsGroupService(String[]
}
private static void validateDescribeOutput(List<String> args, String
errorMessage) {
- String output = ToolsTestUtils.grabConsoleOutput(() ->
StreamsGroupCommand.main(args.toArray(new String[0])));
- assertEquals(errorMessage, output.trim());
+ ToolsTestUtils.MockExitProcedure exitProcedure = new
ToolsTestUtils.MockExitProcedure();
+ Exit.setExitProcedure(exitProcedure);
+ try {
+ String output = ToolsTestUtils.grabConsoleOutput(() ->
StreamsGroupCommand.main(args.toArray(new String[0])));
Review Comment:
Should we call `execute()` instead of `main()` and also get the returned
exitCode and check if it's zero?
For this case, we might not need the try-finally and don't need to
`resetExitProcedure` either?
--
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]