@Test
    void verifyRestfulPolicy() throws Throwable {
        val principal = RegisteredServiceTestUtils.getPrincipal(UUID.randomUUID().toString(),
            Map.of("color", List.of("red", "green"), "memberOf", List.of("admin")));
        val authentication = RegisteredServiceTestUtils.getAuthentication(principal);
        val accessToken = buildAccessToken(authentication);
        ticketRegistry.addTicket(accessToken);

        try (val webServer = new MockWebServer(9581, HttpStatus.OK)) {
            webServer.start();
            mockMvc.perform(post("/heimdall/authorize")
                .contentType(MediaType.APPLICATION_JSON)
                .content(AuthorizationRequest.builder()
                    .uri("/api/rest")
                    .method("POST")
                    .namespace("API_REST")
                    .build()
                    .toJson()
                )
                .header(HttpHeaders.AUTHORIZATION, "Bearer %s".formatted(accessToken.getId()))
                .accept(MediaType.APPLICATION_JSON)
            ).andExpect(status().isOk());
        }
    }
This is {@link HeimdallAuthorizationControllerTests}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-heimdall/src/test/java/org/apereo/cas/heimdall/HeimdallAuthorizationControllerTests.java