/** Test role operation */ @Test public void testRoleOps() throws InvalidObjectException, MetaException, NoSuchObjectException { objectStore.addRole(ROLE1, OWNER); objectStore.addRole(ROLE2, OWNER); List<String> roles = objectStore.listRoleNames(); Assert.assertEquals(2, roles.size()); Assert.assertEquals(ROLE2, roles.get(1)); Role role1 = objectStore.getRole(ROLE1); Assert.assertEquals(OWNER, role1.getOwnerName()); objectStore.grantRole(role1, USER1, PrincipalType.USER, OWNER, PrincipalType.ROLE, true); objectStore.revokeRole(role1, USER1, PrincipalType.USER, false); objectStore.removeRole(ROLE1); }
@Override public List<String> listRoleNames() { return objectStore.listRoleNames(); }