@Test
    void verifyExtractionWithAccessTokenType() throws Throwable {
        val service = addRegisteredService(Set.of(OAuth20GrantTypes.TOKEN_EXCHANGE));
        val request = new MockHttpServletRequest();

        val subjectToken = getAccessToken(service.getServiceId(), service.getClientId());
        ticketRegistry.addTicket(subjectToken);

        val actorToken = getAccessToken(randomServiceUrl(), UUID.randomUUID().toString());
        ticketRegistry.addTicket(actorToken);

        request.addParameter(OAuth20Constants.SUBJECT_TOKEN, subjectToken.getId());
        request.addParameter(OAuth20Constants.SUBJECT_TOKEN_TYPE, OAuth20TokenExchangeTypes.ACCESS_TOKEN.getType());

        request.addParameter(OAuth20Constants.ACTOR_TOKEN, actorToken.getId());
        request.addParameter(OAuth20Constants.ACTOR_TOKEN_TYPE, OAuth20TokenExchangeTypes.ACCESS_TOKEN.getType());

        request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.TOKEN_EXCHANGE.getType());
        request.addParameter(OAuth20Constants.AUDIENCE, service.getClientId());

        val response = new MockHttpServletResponse();
        val context = new JEEContext(request, response);
        assertEquals(OAuth20ResponseTypes.NONE, extractor.getResponseType());
        assertTrue(extractor.supports(context));
        val tokenContext = extractor.extract(context);
        assertNotNull(tokenContext);
        assertNotNull(tokenContext.getSubjectToken());
        assertFalse(tokenContext.getTokenExchangeAudience().isEmpty());
        assertNull(tokenContext.getTokenExchangeResource());
        assertEquals(OAuth20TokenExchangeTypes.ACCESS_TOKEN, tokenContext.getSubjectTokenType());
        assertEquals(OAuth20TokenExchangeTypes.ACCESS_TOKEN, tokenContext.getRequestedTokenType());
        assertNotNull(tokenContext.getActorToken());
    }
This is {@link AccessTokenTokenExchangeGrantRequestExtractorTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/response/accesstoken/ext/AccessTokenTokenExchangeGrantRequestExtractorTests.java