akash-gupta2813 commented on code in PR #1290:
URL: https://github.com/apache/ranger/pull/1290#discussion_r4208075627
##########
security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java:
##########
@@ -3943,6 +3943,104 @@ void
test156GrantBlockedWhenUnauthenticatedAndFlagFalse() throws Exception {
Assertions.assertThrows(WebApplicationException.class, () ->
serviceREST.grantAccess("HDFS_1", grantRequest, request));
}
+ @Test
+ void testGrantAccessMapsUniqueConstraintToConflict409() throws Exception {
+ HttpServletRequest request =
Mockito.mock(HttpServletRequest.class);
+ String serviceName = "HDFS_1";
+ GrantRevokeRequest grantRequestObj = new GrantRevokeRequest();
+
+ Mockito.when(serviceUtil.isValidateHttpsAuthentication(serviceName,
request)).thenReturn(true);
+ Mockito.doThrow(new RuntimeException("Duplicate key
x_policy_UK_service_signature")).when(bizUtil).failUnauthenticatedIfNotAllowed();
Review Comment:
added one more test case for complete grant access api test.
--
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]