Copilot commented on code in PR #12503:
URL: https://github.com/apache/gravitino/pull/12503#discussion_r3924769275


##########
clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/PolicyIT.java:
##########
@@ -494,8 +591,14 @@ public void testAssociatePoliciesToCatalog() {
 
   @Test
   public void testAssociatePoliciesToSchema() {
-    Policy policy1 = 
createCustomPolicy(GravitinoITUtils.genRandomName("policy_it_schema_policy1"));
-    Policy policy2 = 
createCustomPolicy(GravitinoITUtils.genRandomName("policy_it_schema_policy2"));
+    Policy policy1 =
+        createCustomPolicy(
+            GravitinoITUtils.genRandomName("policy_it_schema_policy1"),
+            ImmutableSet.of(MetadataObject.Type.CATALOG));
+    Policy policy2 =
+        createCustomPolicy(
+            GravitinoITUtils.genRandomName("policy_it_schema_policy2"),
+            ImmutableSet.of(MetadataObject.Type.CATALOG));

Review Comment:
   In this test, the policies are associated with a SCHEMA (and policy1 is also 
associated with the CATALOG), but both policies are created with 
supportedObjectTypes = {CATALOG}. This contradicts the documented meaning of 
supportedObjectTypes and could make the test fail once server-side validation 
is tightened (and makes the test data semantically inconsistent today).
   
   This issue also appears on line 804 of the same file.



-- 
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]

Reply via email to