SEC-670: Provide mutator for JdbcMutableAclService.foreignKeysInDatabase property.

This commit is contained in:
Ben Alex
2008-04-05 22:57:02 +00:00
parent 8a7bfafce9
commit 54882fe1ea
2 changed files with 12 additions and 2 deletions

View File

@@ -318,11 +318,14 @@ public class JdbcAclServiceTests extends AbstractTransactionalDataSourceSpringCo
public void testDeleteAclWithChildrenThrowsException() throws Exception {
try {
ObjectIdentity topParentOid = new ObjectIdentityImpl("org.springframework.security.TargetObject", new Long(100));
jdbcMutableAclService.setForeignKeysInDatabase(false); // switch on FK checking in the class, not database
jdbcMutableAclService.deleteAcl(topParentOid, false);
fail("It should have thrown ChildrenExistException");
}
catch (ChildrenExistException expected) {
assertTrue(true);
} finally {
jdbcMutableAclService.setForeignKeysInDatabase(true); // restore to the default
}
}