diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java b/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java index 25532e33fb5..e90c5259638 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java @@ -59,7 +59,6 @@ public class ErrorMessages { public static final String UNKNOWN_ROLE = "Unknown role."; public static final String ROLE_EXISTS = "Role already exists."; public static final String TABLE_EXISTS = "Table already exists."; - public static final String MODEL_EXISTS = "Model already exists."; public static final String INVALID_SET_COMMAND = "Unsupported combination of options either use --name, --user, --group or --property and --value."; public static final String INVALID_REMOVE_COMMAND = diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/LinkModel.java b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/LinkModel.java index 2660382d7cd..6e8a4ffb76d 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/LinkModel.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/LinkModel.java @@ -101,6 +101,6 @@ public void handle() { } System.out.println( - "Link model " + model + " to " + uri + " with alias " + Arrays.toString(alias)); + "Linked model " + model + " to " + uri + " with aliases " + Arrays.toString(alias)); } } diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/RegisterModel.java b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/RegisterModel.java index 5a099266c31..d50dbed50e2 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/RegisterModel.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/RegisterModel.java @@ -22,6 +22,7 @@ import java.util.Map; import org.apache.gravitino.NameIdentifier; import org.apache.gravitino.cli.ErrorMessages; +import org.apache.gravitino.cli.Main; import org.apache.gravitino.client.GravitinoClient; import org.apache.gravitino.exceptions.ModelAlreadyExistsException; import org.apache.gravitino.exceptions.NoSuchCatalogException; @@ -96,6 +97,7 @@ public void handle() { System.out.println("Successful register " + registeredModel.name() + "."); } else { System.err.println("Failed to register model: " + model + "."); + Main.exit(-1); } } } 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 7c3aa511d33..391201f292f 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 @@ -293,6 +293,7 @@ void testModelAuditCommand() { commandLine.handleCommandLine(); verify(mockAudit).handle(); } + @Test void testRegisterModelCommand() { RegisterModel mockCreate = mock(RegisterModel.class);