@Test
    void verifyResolverWithTags() throws Throwable {
        val bindInit = new BindConnectionInitializer("cn=admin,dc=example,dc=org", new Credential("P@ssw0rd"));
        @Cleanup
        val connection = new LDAPConnection("localhost", 11389,
            bindInit.getBindDn(), bindInit.getBindCredential().getString());

        val uid = UUID.randomUUID().toString();
        val ldif = getLdif(uid);
        val rs = new ByteArrayInputStream(ldif.getBytes(StandardCharsets.UTF_8));
        LdapIntegrationTestsOperations.populateEntries(connection, rs, "ou=people,dc=example,dc=org", bindInit);

        val resolver = PersonDirectoryPrincipalResolver.newPersonDirectoryPrincipalResolver(
            applicationContext, PrincipalFactoryUtils.newPrincipalFactory(),
            this.attributeRepository,
            CoreAuthenticationUtils.getAttributeMerger(casProperties.getAuthn().getAttributeRepository().getCore().getMerger()),
            servicesManager, attributeDefinitionStore,
            attributeRepositoryResolver, casProperties.getPersonDirectory());
        val principal = resolver.resolve(new UsernamePasswordCredential(uid, "password"),
            Optional.of(CoreAuthenticationTestUtils.getPrincipal(uid)),
            Optional.of(new SimpleTestUsernamePasswordAuthenticationHandler()),
            Optional.of(CoreAuthenticationTestUtils.getService()));
        assertNotNull(principal);
        assertTrue(principal.getAttributes().containsKey("homePostalAddress;lang-jp"));
        assertTrue(principal.getAttributes().containsKey("homePostalAddress;lang-fr"));
        assertTrue(principal.getAttributes().containsKey("cn"));
        assertTrue(principal.getAttributes().containsKey("surname"));
    }
This is {@link PersonDirectoryPrincipalResolverLdapTests}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-ldap/src/test/java/org/apereo/cas/authentication/PersonDirectoryPrincipalResolverOpenLdapTests.java