justinmclean opened a new issue, #8291:
URL: https://github.com/apache/gravitino/issues/8291

   ### What would you like to be improved?
   
   In 
clients/cli/src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java, 
add a null check for entityType; it should exit if the entity type is null.
   
   Here's a test to help:
   ```
     @Test
     public void testHandle_withoutValidate_shouldExitWithUnknownEntity() {
       OwnerDetails command = new OwnerDetails(context, "metalake1", "entity1", 
"INVALID_TYPE");
   
       ByteArrayOutputStream errContent = new ByteArrayOutputStream();
       PrintStream originalErr = System.err;
       System.setErr(new PrintStream(errContent));
   
       try {
         command.handle();
         fail("Expected RuntimeException due to intercepted exit");
       } catch (RuntimeException e) {
         assertTrue(e.getMessage().contains("Exit with code"));
         
assertTrue(errContent.toString().contains(ErrorMessages.UNKNOWN_ENTITY));
       } finally {
         System.setErr(originalErr);
       }
     }
   ```
   
   ### How should we improve?
   
   exit with ErrorMessages.UNKNOWN_ENTITY


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