/**
* Two authorized entities, one with two principals and the other one principal. Add another
* principal. First authorized entity should have three principals and second unchanged.
*/
public void testAddAcl6() {
Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
new AuthorizedEntity[] {authorizedEntity_r_0_1, authorizedEntity_u_0});
aclTool.addAcl(Arrays.asList(acl), 'r', USER9);
assertEquals(2, acl.getAuthorizedEntities().length);
assertEquals(AuthorizedEntity.OPERATION_RETRIEVE, acl.getAuthorizedEntities()[0].getOperation());
assertEquals(3, acl.getAuthorizedEntities()[0].getEntities().length);
assertEquals(USER0, acl.getAuthorizedEntities()[0].getEntities()[0]);
assertEquals(USER1, acl.getAuthorizedEntities()[0].getEntities()[1]);
assertEquals(USER9, acl.getAuthorizedEntities()[0].getEntities()[2]);
assertEquals(AuthorizedEntity.OPERATION_UPDATE, acl.getAuthorizedEntities()[1].getOperation());
assertEquals(1, acl.getAuthorizedEntities()[1].getEntities().length);
assertEquals(USER0, acl.getAuthorizedEntities()[1].getEntities()[0]);
}