static Stream<Arguments> contextProvider() throws Exception {
        val claims = JWTClaimsSet.parse(Map.of(
            "sub", UUID.randomUUID().toString(),
            "aud", UUID.randomUUID().toString(),
            "iat", ZonedDateTime.now(Clock.systemUTC()).toEpochSecond(),
            "nbf", ZonedDateTime.now(Clock.systemUTC()).toEpochSecond(),
            "exp", ZonedDateTime.now(Clock.systemUTC()).plusHours(2).toEpochSecond(),
            "iss", RegisteredServiceTestUtils.CONST_TEST_URL
        ));
        val jwtRegisteredService = getRegisteredService(claims.getIssuer(), claims.getSubject(),
            UUID.randomUUID().toString(), Set.of(OAuth20GrantTypes.TOKEN_EXCHANGE));
        val jwt = JwtBuilder.buildPlain(claims, Optional.of(jwtRegisteredService));

        val accessToken = getAccessToken(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
        val accessTokenRegisteredService = getRegisteredService(accessToken.getService().getId(),
            accessToken.getClientId(), UUID.randomUUID().toString(), Set.of(OAuth20GrantTypes.TOKEN_EXCHANGE));
        
        val accessTokenBadGrant = getAccessToken(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
        val accessTokenBadGrantService = getRegisteredService(accessTokenBadGrant.getService().getId(),
            accessTokenBadGrant.getClientId(), UUID.randomUUID().toString(), Set.of());

        return Stream.of(
            Arguments.of(accessToken, OAuth20TokenExchangeTypes.ACCESS_TOKEN, accessTokenRegisteredService, true),
            Arguments.of(accessTokenBadGrant, OAuth20TokenExchangeTypes.ACCESS_TOKEN, accessTokenBadGrantService, false),
            Arguments.of(jwt, OAuth20TokenExchangeTypes.JWT, jwtRegisteredService, true)
        );
    }
This is {@link OAuth20TokenExchangeGrantTypeTokenRequestValidatorTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/validator/token/OAuth20TokenExchangeGrantTypeTokenRequestValidatorTests.java