@Test
    void verifyOperation() throws Exception {
        val policy = new DefaultRegisteredServiceOAuthTokenExchangePolicy()
            .setAllowedAudience(CollectionUtils.wrapSet(".*"))
            .setAllowedTokenTypes(Set.of(".*access-token.*"))
            .setAllowedActorTokenTypes(Set.of(".*"));
        assertTrue(policy.isTokenExchangeAllowed(new OAuthRegisteredService(), Set.of("resource"),
            Set.of("audience"), "access-token"));
        MAPPER.writeValue(JSON_FILE, policy);
        val strategyRead = MAPPER.readValue(JSON_FILE, DefaultRegisteredServiceOAuthTokenExchangePolicy.class);
        assertEquals(policy, strategyRead);
    }
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