XN137 commented on code in PR #2291: URL: https://github.com/apache/polaris/pull/2291#discussion_r2269121119
########## 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: there could be an argument that `GRANT_NOT_FOUND` should be a 404 instead of internal server error but it would mean we need to translate all `BaseResult.ReturnStatus` values to a proper HTTP code. i think this can be figured out in a followup and we should first stop silently failing in those cases. -- 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