@Test
    void verifyBasicUserAuthentication() throws Throwable {
        val credentials = EncodingUtils.encodeBase64("casuser:resusac");
        mockMvc.perform(post("/heimdall/authorize")
            .contentType(MediaType.APPLICATION_JSON)
            .content(AuthorizationRequest.builder()
                .uri("/api/basic")
                .method("POST")
                .namespace("API_BASIC")
                .build()
                .toJson()
            )
            .header(HttpHeaders.AUTHORIZATION, "Basic %s".formatted(credentials))
            .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