jerqi commented on code in PR #6515:
URL: https://github.com/apache/gravitino/pull/6515#discussion_r1977025130


##########
authorizations/authorization-ranger/src/test/java/org/apache/gravitino/authorization/ranger/integration/test/RangerHiveIT.java:
##########
@@ -1107,6 +1154,17 @@ public void testOnGrantedRolesToUser() {
         rangerAuthHivePlugin.onGrantedRolesToUser(Lists.newArrayList(role), 
userEntity1));
     verifyRoleInRanger(rangerAuthHivePlugin, role, 
Lists.newArrayList(userName1));
 
+    // test to throw an exception
+    RangerClientExtension client = Mockito.mock(RangerClientExtension.class);
+    RangerClientExtension originClient = 
rangerAuthHivePlugin.getRangerClient();
+    rangerAuthHivePlugin.setRangerClient(client);
+    when(client.searchUser(any())).thenReturn(Mockito.mock(VXUserList.class));
+    when(client.grantRole(any(), any())).thenThrow(new 
AuthorizationPluginException("test"));

Review Comment:
   I correct this.



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