@Test
        void verifyMergingStrategyWithReplacingAttributeAdder() {
            val context = RegisteredServiceAttributeReleasePolicyContext.builder()
                .applicationContext(applicationContext)
                .principal(PRINCIPAL)
                .registeredService(CoreAuthenticationTestUtils.getRegisteredService(UUID.randomUUID().toString(), UUID.randomUUID().toString()))
                .build();

            val repository = getPrincipalAttributesRepository(TimeUnit.SECONDS.name(), 5);
            repository.setAttributeRepositoryIds(Set.of("Stub"));
            repository.setMergingStrategy(PrincipalAttributesCoreProperties.MergingStrategyTypes.REPLACE);
            val repositoryAttributes = repository.getAttributes(context);
            assertTrue(repositoryAttributes.containsKey(MAIL));
            val emailValue = repositoryAttributes.get(MAIL).getFirst().toString();
            assertEquals("final@example.com", emailValue, () -> "Attributes found are %s".formatted(repositoryAttributes));

        }
Handles tests for {@link CachingPrincipalAttributesRepository}.

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