@Test
    void verifyPasswordAsAuthenticationAttribute() {
        val populator = new CacheCredentialsMetaDataPopulator();
        val credential = CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword();
        val builder = DefaultAuthenticationBuilder.newInstance(CoreAuthenticationTestUtils.getAuthentication());
        populator.populateAttributes(builder, CoreAuthenticationTestUtils.getAuthenticationTransactionFactory().newTransaction(credential));
        val authn = builder.build();
        assertTrue(authn.containsAttribute(UsernamePasswordCredential.AUTHENTICATION_ATTRIBUTE_PASSWORD));
        assertEquals(credential.toPassword(), authn.getAttributes().get(UsernamePasswordCredential.AUTHENTICATION_ATTRIBUTE_PASSWORD).getFirst().toString());
    }
Tests for {@link CacheCredentialsMetaDataPopulator}.

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