@Test
        void checkExpiredCachedAttributes() throws Exception {
            val context = RegisteredServiceAttributeReleasePolicyContext.builder()
                .applicationContext(applicationContext)
                .principal(PRINCIPAL)
                .registeredService(CoreAuthenticationTestUtils.getRegisteredService(UUID.randomUUID().toString(), UUID.randomUUID().toString()))
                .build();
            val repository = getPrincipalAttributesRepository(TimeUnit.MILLISECONDS.name(), 100);
            var repoAttrs = repository.getAttributes(context);
            assertEquals(1, repoAttrs.size());
            assertTrue(repoAttrs.containsKey(MAIL));
            Thread.sleep(1_000);
            repository.setMergingStrategy(PrincipalAttributesCoreProperties.MergingStrategyTypes.REPLACE);
            repository.setAttributeRepositoryIds(Set.of("Stub"));
            repoAttrs = repository.getAttributes(context);
            assertEquals(1, repoAttrs.size());
            assertFalse(repoAttrs.containsKey("uid"));
            assertEquals("final@school.com", repoAttrs.get(MAIL).getFirst());

        }
Handles tests for {@link ExpiringPrincipalAttributesRepositoryTests}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core/src/test/java/org/apereo/cas/authentication/principal/cache/ExpiringPrincipalAttributesRepositoryTests.java