@Test
    void verifyRequestWithCallbackWithoutDescription() throws Throwable {
        val service = addRegisteredService();
        val request = new MockHttpServletRequest();
        request.addParameter(OAuth20Constants.CLIENT_ID, service.getClientId());
        request.addParameter(OAuth20Constants.REDIRECT_URI, "https://github.com/apereo/cas");
        request.addParameter(OAuth20Constants.STATE, "abcdefgh");
        request.addParameter(OAuth20Constants.RESPONSE_MODE, OAuth20ResponseModeTypes.FORM_POST.getType());
        request.addParameter("ParameterWhichShouldNotComingBack", "notAtAll");

        val response = new MockHttpServletResponse();
        val context = new JEEContext(request, response);
        assertFalse(oauthInvalidAuthorizationBuilder.supports(context));

        context.setRequestAttribute(OAuth20Constants.ERROR, OAuth20Constants.INVALID_REQUEST);
        context.setRequestAttribute(OAuth20Constants.ERROR_WITH_CALLBACK, true);
        assertTrue(oauthInvalidAuthorizationBuilder.supports(context));

        val mv = oauthInvalidAuthorizationBuilder.build(context);
        assertEquals(CasWebflowConstants.VIEW_ID_POST_RESPONSE, mv.getViewName());
        assertTrue(mv.getModel().containsKey("originalUrl"));
        assertTrue(mv.getModel().containsKey("parameters"));

        val originalUrl = mv.getModel().get("originalUrl");
        assertEquals("https://github.com/apereo/cas", originalUrl);
        val parameters = (Map) mv.getModel().get("parameters");

        assertTrue(parameters.containsKey(OAuth20Constants.ERROR));
        assertFalse(parameters.containsKey(OAuth20Constants.ERROR_DESCRIPTION));
        assertTrue(parameters.containsKey(OAuth20Constants.STATE));
        assertEquals(OAuth20Constants.INVALID_REQUEST, parameters.get(OAuth20Constants.ERROR));
        assertEquals("abcdefgh", parameters.get(OAuth20Constants.STATE));
    }
This is {@link OAuth20InvalidAuthorizationResponseBuilderTests}.

@author Julien Huon
@since 6.4.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/response/callback/OAuth20InvalidAuthorizationResponseBuilderTests.java