@Test
public void testAddRole() {
TAlterSentryRoleAddGroupsRequest request = new TAlterSentryRoleAddGroupsRequest();
TAlterSentryRoleAddGroupsResponse response = new TAlterSentryRoleAddGroupsResponse();
request.setRequestorUserName(TEST_USER_NAME);
request.setRoleName(TEST_ROLE_NAME);
request.setGroups(getGroups());
response.setStatus(Status.OK());
GMAuditMetadataLogEntity amle = (GMAuditMetadataLogEntity) JsonLogEntityFactory.getInstance()
.createJsonLogEntity(request, response, conf);
assertCommon(amle, Constants.TRUE, Constants.OPERATION_ADD_ROLE,
"GRANT ROLE testRole TO GROUP testGroup", Constants.OBJECT_TYPE_ROLE,
new HashMap<String, String>());
response.setStatus(Status.InvalidInput("", null));
amle = (GMAuditMetadataLogEntity) JsonLogEntityFactory.getInstance().createJsonLogEntity(
request, response, conf);
assertCommon(amle, Constants.FALSE, Constants.OPERATION_ADD_ROLE,
"GRANT ROLE testRole TO GROUP testGroup", Constants.OBJECT_TYPE_ROLE,
new HashMap<String, String>());
}