Skip to content

Commit

Permalink
[#5960] fix(CLI): Add register and link commands to CLI for model
Browse files Browse the repository at this point in the history
Fix some error.
  • Loading branch information
Abyss-lord committed Jan 3, 2025
1 parent ce05d1b commit a0fe9a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ void testModelAuditCommand() {
commandLine.handleCommandLine();
verify(mockAudit).handle();
}

@Test
void testRegisterModelCommand() {
RegisterModel mockCreate = mock(RegisterModel.class);
Expand Down

0 comments on commit a0fe9a2

Please sign in to comment.