Class AclLinterParentInheritanceTest

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseDatabaseTest5
ubic.gemma.core.security.authorization.acl.AclLinterParentInheritanceTest

@ContextConfiguration @TestExecutionListeners(value=org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener.class, mergeMode=MERGE_WITH_DEFAULTS) public class AclLinterParentInheritanceTest extends BaseDatabaseTest5
Coverage for the entries_inheriting half of AclLinterServiceImpl.setParentAcl.

This test wires the ACL stack the way production does — JdbcMutableAclService over the canonical four tables — instead of the Hibernate AclServiceImpl / AclDaoImpl pair that BaseDatabaseTest5 defaults to. That is not a preference: AclObjectIdentity is @Entity and @Immutable, so on the Hibernate path Hibernate discards the dirty state and NO ACL update reaches the database at all. A test on that path can neither confirm nor refute anything about what setParentAcl writes — it would pass whatever the linter did. Overriding the bean is what makes the assertions mean something.

See Also:
  • Constructor Details

    • AclLinterParentInheritanceTest

      public AclLinterParentInheritanceTest()
  • Method Details

    • testLinkingAParentTurnsOnEntriesInheriting

      @Test @WithMockUser(username="administrator", authorities="GROUP_ADMIN") public void testLinkingAParentTurnsOnEntriesInheriting()
      A child whose identity has entries_inheriting off gains nothing from a parent link — Spring only walks to the parent when the flag is on — so the linter has to set both. The flag is off on exactly the rows this repair targets: BaseAclAdvice sets it from inheritFromParent, false when no parent was discoverable at insert time, which is the same branch that leaves the child holding its own ACEs. On production that shape is 631,709 BioAssay and 631,709 BioMaterial identities, each with the GROUP_ADMIN + GROUP_AGENT pair and no parent.