diff --git a/clients/cli/src/test/java/org/apache/gravitino/cli/TestModelCommands.java b/clients/cli/src/test/java/org/apache/gravitino/cli/TestModelCommands.java index b83cc3c3136..4f1507cc703 100644 --- a/clients/cli/src/test/java/org/apache/gravitino/cli/TestModelCommands.java +++ b/clients/cli/src/test/java/org/apache/gravitino/cli/TestModelCommands.java @@ -89,11 +89,7 @@ void testListModelCommand() { doReturn(mockList) .when(commandLine) .newListModel( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("catalog"), - eq("schema")); + GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", "catalog", "schema"); doReturn(mockList).when(mockList).validate(); commandLine.handleCommandLine(); verify(mockList).handle(); @@ -112,12 +108,7 @@ void testListModelCommandWithoutCatalog() { assertThrows(RuntimeException.class, commandLine::handleCommandLine); verify(commandLine, never()) - .newListModel( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - isNull(), - isNull()); + .newListModel(GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", null, null); String output = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals( ErrorMessages.MISSING_NAME @@ -141,12 +132,7 @@ void testListModelCommandWithoutSchema() { assertThrows(RuntimeException.class, commandLine::handleCommandLine); verify(commandLine, never()) - .newListModel( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("catalog"), - isNull()); + .newListModel(GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", "catalog", null); String output = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals( ErrorMessages.MALFORMED_NAME @@ -171,12 +157,7 @@ void testModelDetailsCommand() { doReturn(mockList) .when(commandLine) .newModelDetails( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("catalog"), - eq("schema"), - eq("model")); + GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", "catalog", "schema", "model"); doReturn(mockList).when(mockList).validate(); commandLine.handleCommandLine(); verify(mockList).handle(); @@ -197,12 +178,7 @@ void testModelDetailsCommandWithoutCatalog() { verify(commandLine, never()) .newModelDetails( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - isNull(), - isNull(), - isNull()); + GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", null, null, null); String output = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals( ErrorMessages.MISSING_NAME @@ -230,12 +206,7 @@ void testModelDetailsCommandWithoutSchema() { verify(commandLine, never()) .newModelDetails( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("catalog"), - isNull(), - isNull()); + GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", "catalog", null, null); String output = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals( ErrorMessages.MALFORMED_NAME @@ -261,12 +232,7 @@ void testModelDetailsCommandWithoutModel() { verify(commandLine, never()) .newModelDetails( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("catalog"), - eq("schema"), - isNull()); + GravitinoCommandLine.DEFAULT_URL, false, "metalake_demo", "catalog", "schema", null); String output = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals( ErrorMessages.MALFORMED_NAME diff --git a/clients/cli/src/test/java/org/apache/gravitino/cli/TestOwnerCommands.java b/clients/cli/src/test/java/org/apache/gravitino/cli/TestOwnerCommands.java index 12f617380ca..f3928fba28f 100644 --- a/clients/cli/src/test/java/org/apache/gravitino/cli/TestOwnerCommands.java +++ b/clients/cli/src/test/java/org/apache/gravitino/cli/TestOwnerCommands.java @@ -21,8 +21,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -160,11 +158,11 @@ void testOwnerDetailsCommandWithoutName() { assertThrows(RuntimeException.class, commandLine::handleCommandLine); verify(commandLine, never()) .newOwnerDetails( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq(null), - eq(CommandEntities.CATALOG)); + GravitinoCommandLine.DEFAULT_URL, + false, + "metalake_demo", + null, + CommandEntities.CATALOG); String errOutput = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals(ErrorMessages.MISSING_NAME, errOutput); @@ -188,13 +186,13 @@ void testSetOwnerUserCommandWithoutUserAndGroup() { assertThrows(RuntimeException.class, commandLine::handleCommandLine); verify(commandLine, never()) .newSetOwner( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq("postgres"), - eq(CommandEntities.CATALOG), - isNull(), - eq(false)); + GravitinoCommandLine.DEFAULT_URL, + false, + "metalake_demo", + "postgres", + CommandEntities.CATALOG, + null, + false); String errOutput = new String(errContent.toByteArray(), StandardCharsets.UTF_8).trim(); assertEquals(ErrorMessages.INVALID_SET_COMMAND, errOutput); } diff --git a/clients/cli/src/test/java/org/apache/gravitino/cli/TestRoleCommands.java b/clients/cli/src/test/java/org/apache/gravitino/cli/TestRoleCommands.java index 2b4ab474521..be463019fd3 100644 --- a/clients/cli/src/test/java/org/apache/gravitino/cli/TestRoleCommands.java +++ b/clients/cli/src/test/java/org/apache/gravitino/cli/TestRoleCommands.java @@ -185,10 +185,10 @@ void testCreateRolesCommand() { doReturn(mockCreate) .when(commandLine) .newCreateRole( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq("metalake_demo"), - eq(new String[] {"admin", "engineer", "scientist"})); + GravitinoCommandLine.DEFAULT_URL, + false, + "metalake_demo", + new String[] {"admin", "engineer", "scientist"}); doReturn(mockCreate).when(mockCreate).validate(); commandLine.handleCommandLine(); verify(mockCreate).handle(); @@ -235,11 +235,11 @@ void testDeleteRolesCommand() { doReturn(mockDelete) .when(commandLine) .newDeleteRole( - eq(GravitinoCommandLine.DEFAULT_URL), - eq(false), - eq(false), - eq("metalake_demo"), - eq(new String[] {"admin", "engineer", "scientist"})); + GravitinoCommandLine.DEFAULT_URL, + false, + false, + "metalake_demo", + new String[] {"admin", "engineer", "scientist"}); doReturn(mockDelete).when(mockDelete).validate(); commandLine.handleCommandLine(); verify(mockDelete).handle();