@Test
    void verifyMultiplePrincipalAttributeNamesNotFound() throws Throwable {
        val context1 = getPrincipalResolutionContextBuilder()
            .returnNullIfNoAttributes(false)
            .principalNameTransformer(formUserId -> formUserId)
            .useCurrentPrincipalId(false)
            .resolveAttributes(true)
            .activeAttributeRepositoryIdentifiers(CollectionUtils.wrapSet(PersonAttributeDao.WILDCARD))
            .build();
        val resolver = new PersonDirectoryPrincipalResolver(context1);

        val context2 = getPrincipalResolutionContextBuilder(casProperties.getAuthn().getAttributeRepository().getCore().getMerger(),
            new StubPersonAttributeDao(Map.of("something", CollectionUtils.wrap("principal-id"))))
            .returnNullIfNoAttributes(false)
            .principalNameTransformer(formUserId -> formUserId)
            .useCurrentPrincipalId(false)
            .principalAttributeNames(" invalid, ")
            .resolveAttributes(true)
            .activeAttributeRepositoryIdentifiers(CollectionUtils.wrapSet(PersonAttributeDao.WILDCARD))
            .build();
        val resolver2 = new PersonDirectoryPrincipalResolver(context2);
        val chain = buildResolver(List.of(new EchoingPrincipalResolver(), resolver, resolver2));

        val principal = chain.resolve(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword(),
            Optional.of(CoreAuthenticationTestUtils.getPrincipal("somethingelse", Map.of(ATTR_1, List.of("value")))),
            Optional.of(new SimpleTestUsernamePasswordAuthenticationHandler()),
            Optional.of(CoreAuthenticationTestUtils.getService()));
        assertNotNull(principal);
        assertEquals("test", principal.getId());
    }
Test cases for {@link PersonDirectoryPrincipalResolver}.

@author Misagh Moayyed
@since 4.2
support/cas-server-support-person-directory-core/src/test/java/org/apereo/cas/authentication/principal/resolvers/PersonDirectoryPrincipalResolverTests.java