justinmclean commented on code in PR #5907:
URL: https://github.com/apache/gravitino/pull/5907#discussion_r1895080585


##########
clients/cli/src/test/java/org/apache/gravitino/cli/TestCatalogCommands.java:
##########
@@ -38,17 +46,44 @@
 import org.apache.gravitino.cli.commands.SetCatalogProperty;
 import org.apache.gravitino.cli.commands.UpdateCatalogComment;
 import org.apache.gravitino.cli.commands.UpdateCatalogName;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 class TestCatalogCommands {
   private CommandLine mockCommandLine;
   private Options mockOptions;
 
+  private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
+  private final ByteArrayOutputStream errContent = new ByteArrayOutputStream();
+  private final PrintStream originalOut = System.out;
+  private final PrintStream originalErr = System.err;
+  private final SecurityManager securityManager =
+      new SecurityManager() {
+        public void checkPermission(Permission permission) {
+          if (permission.getName().startsWith("exitVM")) {
+            throw new RuntimeException(permission.getName());
+          }
+        }
+      };
+

Review Comment:
   No need for this, use the flag so Main.exit(-1) throws an exception.



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