@Test
    void verifyMissingGrant() throws Throwable {
        var results = authenticateUmaRequestWithAuthorizationScope();
        var authzRequest = new UmaAuthorizationRequest().toJson();
        var response = umaAuthorizationRequestEndpointController.handleAuthorizationRequest(authzRequest,
            results.getLeft(), results.getMiddle());
        assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());

        authzRequest = new UmaAuthorizationRequest()
            .setGrantType(null)
            .toJson();
        response = umaAuthorizationRequestEndpointController.handleAuthorizationRequest(authzRequest,
            results.getLeft(), results.getMiddle());
        assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());

        authzRequest = new UmaAuthorizationRequest()
            .setGrantType("unknown")
            .toJson();
        response = umaAuthorizationRequestEndpointController.handleAuthorizationRequest(authzRequest,
            results.getLeft(), results.getMiddle());
        assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());

        authzRequest = new UmaAuthorizationRequest()
            .setGrantType(OAuth20GrantTypes.UMA_TICKET.getType())
            .setTicket(null)
            .toJson();
        response = umaAuthorizationRequestEndpointController.handleAuthorizationRequest(authzRequest, results.getLeft(), results.getMiddle());
        assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());

        authzRequest = new UmaAuthorizationRequest()
            .setGrantType(OAuth20GrantTypes.UMA_TICKET.getType())
            .setTicket("unknown-ticket")
            .toJson();
        response = umaAuthorizationRequestEndpointController.handleAuthorizationRequest(authzRequest, results.getLeft(), results.getMiddle());
        assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());
    }
This is {@link UmaAuthorizationRequestEndpointControllerTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth-uma/src/test/java/org/apereo/cas/uma/web/controllers/authz/UmaAuthorizationRequestEndpointControllerTests.java