snazy commented on code in PR #2291:
URL: https://github.com/apache/polaris/pull/2291#discussion_r2269591361


##########
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java:
##########
@@ -1743,14 +1745,32 @@ public void 
testCatalogAdminGrantAndRevokeCatalogRoles() {
         managementApi
             .request(
                 "v1/principal-roles/"
-                    + principalRoleName
+                    + principalRoleName2
                     + "/catalog-roles/"
                     + catalogName
                     + "/"
                     + catalogRoleName)
             .delete()) {
       assertThat(response).returns(Response.Status.NO_CONTENT.getStatusCode(), 
Response::getStatus);
     }
+
+    // trigger an internal error by using "principalRoleName" instead of 
"principalRoleName2"
+    try (Response response =
+        managementApi
+            .request(
+                "v1/principal-roles/"
+                    + principalRoleName
+                    + "/catalog-roles/"
+                    + catalogName
+                    + "/"
+                    + catalogRoleName)
+            .delete()) {
+      assertThat(response)
+          .returns(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), 
Response::getStatus);
+      assertThat(response.hasEntity()).isTrue();
+      ErrorResponse errorResponse = response.readEntity(ErrorResponse.class);
+      assertThat(errorResponse.message()).contains("Operation failed: 
GRANT_NOT_FOUND");

Review Comment:
   Hm - HTTP/500 feels odd, as it's rather a user (argument) error. HTTP/400 
would be better IMHO.



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to