@Test
    void checkAttributesWithRepository() throws Throwable {
        val principal = PrincipalFactoryUtils.newPrincipalFactory().createPrincipal("uid",
            Map.of("mail", List.of("final@example.com")));
        val context = RegisteredServiceAttributeReleasePolicyContext.builder()
            .applicationContext(applicationContext)
            .principal(principal)
            .registeredService(CoreAuthenticationTestUtils.getRegisteredService())
            .build();

        val rep = new DefaultPrincipalAttributesRepository();
        rep.setMergingStrategy(PrincipalAttributesCoreProperties.MergingStrategyTypes.SOURCE);
        rep.setAttributeRepositoryIds(Set.of("StubPersonAttributeDao"));
        assertEquals(1, rep.getAttributes(context).size());
        assertTrue(rep.getAttributes(context).containsKey("mail"));

    }
Handles tests for {@link DefaultPrincipalAttributesRepository}.

@author Misagh Moayyed
@since 4.1
support/cas-server-support-person-directory/src/test/java/org/apereo/cas/DefaultPrincipalAttributesRepositoryTests.java