protected ModelAndView generateAccessTokenResponseAndGetModelAndView(
        final OAuthRegisteredService registeredService,
        final Authentication authentication,
        final OAuth20GrantTypes grantType) throws Throwable {

        val mockRequest = new MockHttpServletRequest(HttpMethod.GET.name(), CONTEXT + OAuth20Constants.ACCESS_TOKEN_URL);
        return generateAccessTokenResponseAndGetModelAndView(registeredService, authentication, grantType, mockRequest);
    }
This is {@link AbstractOAuth20Tests}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/AbstractOAuth20Tests.java