justinmclean commented on code in PR #6198:
URL: https://github.com/apache/gravitino/pull/6198#discussion_r1912628960
##########
clients/cli/src/test/java/org/apache/gravitino/cli/TestCatalogCommands.java:
##########
@@ -201,35 +204,48 @@ void testDeleteCatalogCommand() {
when(mockCommandLine.getOptionValue(GravitinoOptions.METALAKE)).thenReturn("metalake_demo");
when(mockCommandLine.hasOption(GravitinoOptions.NAME)).thenReturn(true);
when(mockCommandLine.getOptionValue(GravitinoOptions.NAME)).thenReturn("catalog");
+ when(mockCommandLine.hasOption(GravitinoOptions.QUIET)).thenReturn(false);
GravitinoCommandLine commandLine =
spy(
new GravitinoCommandLine(
mockCommandLine, mockOptions, CommandEntities.CATALOG,
CommandActions.DELETE));
doReturn(mockDelete)
.when(commandLine)
.newDeleteCatalog(
- GravitinoCommandLine.DEFAULT_URL, false, false, "metalake_demo",
"catalog");
+ eq(GravitinoCommandLine.DEFAULT_URL),
+ eq(false),
+ eq(false),
+ eq(false),
+ eq("metalake_demo"),
+ eq("catalog"));
doReturn(mockDelete).when(mockDelete).validate();
commandLine.handleCommandLine();
verify(mockDelete).handle();
}
@Test
void testDeleteCatalogForceCommand() {
+ Main.useExit = false;
DeleteCatalog mockDelete = mock(DeleteCatalog.class);
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");
when(mockCommandLine.hasOption(GravitinoOptions.FORCE)).thenReturn(true);
+ when(mockCommandLine.hasOption(GravitinoOptions.QUIET)).thenReturn(false);
GravitinoCommandLine commandLine =
spy(
new GravitinoCommandLine(
mockCommandLine, mockOptions, CommandEntities.CATALOG,
CommandActions.DELETE));
doReturn(mockDelete)
.when(commandLine)
.newDeleteCatalog(
- GravitinoCommandLine.DEFAULT_URL, false, true, "metalake_demo",
"catalog");
+ eq(GravitinoCommandLine.DEFAULT_URL),
+ eq(false),
+ eq(false),
+ eq(true),
+ eq("metalake_demo"),
+ eq("catalog"));
Review Comment:
no need for the eqs?
--
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]