VigneshSK17 commented on code in PR #6163:
URL: https://github.com/apache/gravitino/pull/6163#discussion_r1917639135
##########
clients/cli/src/test/java/org/apache/gravitino/cli/TestCatalogCommands.java:
##########
@@ -525,12 +525,19 @@ void testCatalogWithDisableAndEnableOptions() {
new GravitinoCommandLine(
mockCommandLine, mockOptions, CommandEntities.CATALOG,
CommandActions.UPDATE));
- assertThrows(RuntimeException.class, commandLine::handleCommandLine);
- verify(commandLine, never())
- .newCatalogEnable(
- GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo",
"catalog", false);
- verify(commandLine, never())
- .newCatalogDisable(GravitinoCommandLine.DEFAULT_URL, false,
"melake_demo", "catalog");
-
assertTrue(errContent.toString().contains(ErrorMessages.INVALID_ENABLE_DISABLE));
+ assertThrows(
+ RuntimeException.class,
+ () ->
+ commandLine
+ .newCatalogEnable(
+ GravitinoCommandLine.DEFAULT_URL,
+ false,
+ "metalake_demo",
+ "catalog",
+ true,
+ false)
+ .validate());
+ String errOutput = new String(errContent.toByteArray(),
StandardCharsets.UTF_8).trim();
+ Assertions.assertEquals(ErrorMessages.INVALID_ENABLE_DISABLE, errOutput);
Review Comment:
My understanding is that I should detect if there's a RuntimeException when
trying to enable and disable a catalog at the same time and then check if the
error message is INVALID_ENABLE_DISABLE.
Is there an alternative to simplify this test or is am I misunderstanding
the intent of these tests?
--
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]