Copilot commented on code in PR #4750:
URL: https://github.com/apache/polaris/pull/4750#discussion_r3408862689
##########
runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogHandlerAuthzTest.java:
##########
@@ -1296,6 +1297,17 @@ public void
testRenameTablePrivilegesOnWrongSourceOrDestination() {
adminService.grantPrivilegeOnNamespaceToRole(
CATALOG_NAME, CATALOG_ROLE1, NS2, PolarisPrivilege.TABLE_CREATE));
newHandler().renameTable(rename2);
+
+ // Verify that renaming a non-existent source reports the source
identifier in the error
+ TableIdentifier nonExistentSource = TableIdentifier.of(NS1,
"no_such_table");
+ RenameTableRequest badRename =
+ RenameTableRequest.builder()
+ .withSource(nonExistentSource)
+ .withDestination(dstTable)
+ .build();
+ Assertions.assertThatThrownBy(() -> newHandler().renameTable(badRename))
+ .isInstanceOf(NoSuchTableException.class)
+ .hasMessageContaining(nonExistentSource.toString());
Review Comment:
This assertion currently depends on `dstTable` not triggering a different
precondition failure (e.g., destination already exists / destination validation
order changes). To make the test robust to future changes in validation order,
use a guaranteed-nonexistent destination identifier (in an existing namespace)
specifically for this check, so the failure deterministically reflects the
missing source.
--
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]