@Test
    void verifySurrogatePrincipalFound() throws Throwable {
        val service = CoreAuthenticationTestUtils.getService(UUID.randomUUID().toString());
        val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of());
        servicesManager.save(registeredService);


        val credential = new BasicIdentifiableCredential("casuser");
        credential.getCredentialMetadata().addTrait(new SurrogateCredentialTrait("cassurrogate"));
        val surrogatePrincipal = surrogateDelegatedAuthenticationPreProcessor.process(RegisteredServiceTestUtils.getPrincipal("casuser"),
            mock(BaseClient.class), credential, service);
        assertInstanceOf(SurrogatePrincipal.class, surrogatePrincipal);
    }
This is {@link SurrogateDelegatedAuthenticationPreProcessorTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-surrogate-webflow/src/test/java/org/apereo/cas/web/flow/pac4j/SurrogateDelegatedAuthenticationPreProcessorTests.java