@Test
    void verifyActorToken() {
        val policy = new DefaultRegisteredServiceOAuthTokenExchangePolicy()
            .setAllowedActorTokenTypes(Set.of(".*"))
            .setRequiredActorTokenAttributes(Map.of("common-name", List.of("nothing|.*cas")));
        val actor = CoreAuthenticationTestUtils.getAuthentication(
            CoreAuthenticationTestUtils.getPrincipal(UUID.randomUUID().toString(), Map.of("common-name", List.of("anything-cas"))));
        val subject = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal(UUID.randomUUID().toString()));
        assertTrue(policy.canSubjectTokenActAs(subject, actor, "anything"));
    }
This is {@link DefaultRegisteredServiceOAuthTokenExchangePolicyTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth-services/src/test/java/org/apereo/cas/support/oauth/services/DefaultRegisteredServiceOAuthTokenExchangePolicyTests.java