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

   ### What would you like to be improved?
   
   Make the fileset update command in the CLI exit with an error when neither 
--comment nor --rename is specified.
   
   
clients/cli/src/main/java/org/apache/gravitino/cli/FilesetCommandHandler.java 
will need to be updated.
   
   Here's a test for that:
   ```
     @Test
     void testUpdateFilesetCommandWithoutOptions() {
       Main.useExit = false;
   
       
when(mockCommandLine.hasOption(GravitinoOptions.METALAKE)).thenReturn(true);
       when(mockCommandLine.getOptionValue(GravitinoOptions.METALAKE))
           .thenReturn("metalake_demo");
       when(mockCommandLine.hasOption(GravitinoOptions.NAME)).thenReturn(true);
       when(mockCommandLine.getOptionValue(GravitinoOptions.NAME))
           .thenReturn("catalog.schema.fileset");
   
       GravitinoCommandLine commandLine =
           new GravitinoCommandLine(
               mockCommandLine, mockOptions, CommandEntities.FILESET, 
CommandActions.UPDATE);
   
       assertThrows(RuntimeException.class, commandLine::handleCommandLine);
       String errOutput = new String(errContent.toByteArray(), 
StandardCharsets.UTF_8).trim();
       assertEquals(ErrorMessages.MISSING_COMMENT_OR_RENAME, errOutput);
     }
   ```
   
   ### How should we improve?
   
   as above


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