@Test
    void verifyOperation() throws Throwable {
        val resolver = new ProxyingPrincipalResolver(PrincipalFactoryUtils.newPrincipalFactory());
        assertFalse(resolver.supports(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword()));
        val credential = new HttpBasedServiceCredential("https://example.org", CoreAuthenticationTestUtils.getRegisteredService());
        var principal = resolver.resolve(credential);
        assertEquals(credential.getId(), principal.getId());
        principal = resolver.resolve(credential,
            Optional.of(CoreAuthenticationTestUtils.getPrincipal("helloworld")),
            Optional.empty(), Optional.empty());
        assertEquals("helloworld", principal.getId());
        assertTrue(principal.containsAttribute(HttpBasedServiceCredential.class.getName()));
        assertTrue(credential.getCredentialMetadata().containsProperty(HttpBasedServiceCredential.class.getName()));
    }
This is {@link ProxyingPrincipalResolverTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-authentication-api/src/test/java/org/apereo/cas/authentication/principal/resolvers/ProxyingPrincipalResolverTests.java