@Test
    void verifyResolverSurrogateWithoutPrincipal() {
        val surrogatePrincipalBuilder = getBuilder();

        val context = getPrincipalResolutionContext("cn", CoreAuthenticationTestUtils.getAttributeRepository());
        val resolver = new SurrogatePrincipalResolver(context);
        resolver.setSurrogatePrincipalBuilder(surrogatePrincipalBuilder);
        val credential = new UsernamePasswordCredential();
        credential.setUsername("something");
        credential.getCredentialMetadata().addTrait(new SurrogateCredentialTrait("something2"));
        assertThrows(IllegalArgumentException.class, () -> resolver.resolve(credential));
    }
This is {@link SurrogatePrincipalResolverTests}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/authentication/SurrogatePrincipalResolverTests.java