VigneshSK17 commented on code in PR #6163:
URL: https://github.com/apache/gravitino/pull/6163#discussion_r1919354360


##########
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:
   Oh I see what you mean.
   
   The reason why is because to check if both flags are true, I pass the 
disable flag's result into EnableCatalogCommand as a required parameter.
   
   Is this the proper standard or not? Apologies for dragging this on for so 
long.



-- 
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]

Reply via email to