TestResource resource = (TestResource) entry.getResource();
entriesMap.put(resource.getResourceId(), entry);
}
// identity should have create, update, read and delete permissions over resources 2 and 3.
EntitlementEntry entry = entriesMap.get(2);
assertNotNull(entry);
CompositeACLPermission expectedPermission = new CompositeACLPermission(BasicACLPermission.values());
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
entry = entriesMap.get(3);
assertNotNull(entry);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
// identity should have read and update permissions over resources 4 and 6.
entry = entriesMap.get(4);
assertNotNull(entry);
expectedPermission = new CompositeACLPermission(BasicACLPermission.READ, BasicACLPermission.UPDATE);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
entry = entriesMap.get(6);
assertNotNull(entry);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
// identity should have create, read and delete permissions over resources 5 and 8.
entry = entriesMap.get(5);
assertNotNull(entry);
expectedPermission = new CompositeACLPermission(BasicACLPermission.CREATE, BasicACLPermission.READ,
BasicACLPermission.DELETE);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
entry = entriesMap.get(8);
assertNotNull(entry);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
// identity should have read permission over resource 9.
entry = entriesMap.get(9);
assertNotNull(entry);
expectedPermission = new CompositeACLPermission(BasicACLPermission.READ);
assertEquals("Found unexpected permissions", expectedPermission, entry.getPermission());
}