@Test
        void verifyRepositoriesByServiceAssignment() {
            val registeredService = RegisteredServiceTestUtils.getRegisteredService(UUID.randomUUID().toString());
            val releasePolicy = new DenyAllAttributeReleasePolicy();
            releasePolicy.setPrincipalAttributesRepository(new DefaultPrincipalAttributesRepository().setAttributeRepositoryIds(Set.of("stub")));

            registeredService.setAttributeReleasePolicy(releasePolicy);
            servicesManager.save(registeredService);

            val query = AttributeRepositoryQuery.builder()
                .activeRepositoryIds(Set.of("stub", "ldap"))
                .authenticationHandler(new SimpleTestUsernamePasswordAuthenticationHandler("simpleHandler"))
                .principal(RegisteredServiceTestUtils.getPrincipal())
                .service(RegisteredServiceTestUtils.getService(registeredService.getServiceId()))
                .build();
            val results = attributeRepositoryResolver.resolve(query);
            assertEquals(1, results.size());
            assertTrue(results.contains("stub"));
        }
This is {@link DefaultAttributeRepositoryResolverTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-person-directory/src/test/java/org/apereo/cas/persondir/DefaultAttributeRepositoryResolverTests.java