// =====================================================================
// =====================================================================
// Test Expectations
// =====================================================================
MutableACL acl = factory.createACL(principalMock);
// The principal with which the ACL is first created is an owner.
assertTrue(acl.isOwner(principalMock));
// Another principal is not an owner.
assertFalse(acl.isOwner(otherMock));
// Adding the principal again should return false.
assertFalse(acl.addOwner(principalMock, principalMock));
// Adding another principal should return true and it is then an owner.
assertTrue(acl.addOwner(principalMock, otherMock));
assertTrue(acl.isOwner(otherMock));
// Removing the original principal should return true, removing it
// again should return false.
assertTrue(acl.deleteOwner(principalMock, principalMock));
assertFalse(acl.deleteOwner(otherMock, principalMock));
// Attempting to remove the last owner should fail.
try {
acl.deleteOwner(otherMock, otherMock);
fail("Did not detect attempt to remove last owner");
} catch (LastOwnerException expected) {
}
}