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

        val payload = JwtBuilder.JwtRequest
            .builder()
            .registeredService(Optional.of(registeredService))
            .serviceAudience(Set.of(UUID.randomUUID().toString()))
            .issuer(registeredService.getClientId())
            .jwtId(UUID.randomUUID().toString())
            .subject(UUID.randomUUID().toString())
            .issueDate(new Date())
            .build();

        val jwtString = accessTokenJwtBuilder.build(payload);

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

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

        request.addParameter(OAuth20Constants.ACTOR_TOKEN, jwtString);
        request.addParameter(OAuth20Constants.ACTOR_TOKEN_TYPE, OAuth20TokenExchangeTypes.JWT.getType());

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

        val response = new MockHttpServletResponse();
        val context = new JEEContext(request, response);

        val userProfile = new CommonProfile();
        userProfile.setId("casuser");
        userProfile.addAttributes((Map) RegisteredServiceTestUtils.getTestAttributes());
        new ProfileManager(context, oauthDistributedSessionStore).save(true, userProfile, false);

        val tokenContext = extractor.extract(context);
        assertNotNull(tokenContext);
    }
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