@Test
    void verifyOperationWithUsernamePasswordCredentialType() throws Throwable {
        val context = PrincipalResolutionContext.builder()
            .attributeDefinitionStore(attributeDefinitionStore)
            .attributeRepositoryResolver(attributeRepositoryResolver)
            .servicesManager(servicesManager)
            .attributeMerger(CoreAuthenticationUtils.getAttributeMerger(PrincipalAttributesCoreProperties.MergingStrategyTypes.MULTIVALUED))
            .attributeRepository(attributeRepository)
            .applicationContext(applicationContext)
            .principalFactory(PrincipalFactoryUtils.newPrincipalFactory())
            .resolveAttributes(true)
            .build();
        val resolver = new PersonDirectoryPrincipalResolver(context);
        val credential = CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword("casuser");
        val principal = resolver.resolve(credential, Optional.of(CoreAuthenticationTestUtils.getPrincipal()),
            Optional.of(new SimpleTestUsernamePasswordAuthenticationHandler()),
            Optional.of(CoreAuthenticationTestUtils.getService()));
        assertNotNull(principal);
        assertTrue(principal.getAttributes().containsKey("PersonName"));
    }
This is {@link PrincipalAttributeRepositoryFetcherJdbcTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-jdbc/src/test/java/org/apereo/cas/jdbc/PrincipalAttributeRepositoryFetcherJdbcTests.java