@Test
    void verifyOperation() throws Throwable {
        assertFalse(surrogateService.isWildcardedAccount(List.of("cassystem"), Optional.empty()));
        assertFalse(surrogateService.isWildcardedAccount("cassystem", RegisteredServiceTestUtils.getPrincipal(), Optional.empty()));

        val accounts = surrogateService.getImpersonationAccounts("casuser", Optional.empty());
        assertTrue(accounts.contains("user1"));
        assertTrue(accounts.contains("user2"));
        assertTrue(accounts.contains("user3"));
        assertTrue(surrogateService.canImpersonate("user3", RegisteredServiceTestUtils.getPrincipal("casuser"), Optional.empty()));
        assertTrue(surrogateService.canImpersonate("tomhanks", RegisteredServiceTestUtils.getPrincipal("adminuser"), Optional.empty()));
    }
This is {@link ChainingSurrogateAuthenticationServiceTests}.

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