@Test
    void verifyOperation() throws Throwable {
        var result = MAPPER.readValue(mockMvc.perform(get("/actuator/throttles")
                .contentType(MediaType.APPLICATION_JSON)
                .accept(MediaType.APPLICATION_JSON)
            )
            .andExpect(status().isOk())
            .andReturn()
            .getResponse()
            .getContentAsString(), List.class);
        assertTrue(result.isEmpty());

        val request = new MockHttpServletRequest();
        request.setRemoteAddr("1.2.3.4");
        request.setLocalAddr("4.5.6.7");
        request.setRemoteUser("cas");
        request.addHeader(HttpHeaders.USER_AGENT, "Firefox");
        ClientInfoHolder.setClientInfo(ClientInfo.from(request));

        throttle.recordSubmissionFailure(request);

        val records = MAPPER.readValue(mockMvc.perform(get("/actuator/throttles")
                .contentType(MediaType.APPLICATION_JSON)
                .accept(MediaType.APPLICATION_JSON)
            )
            .andExpect(status().isOk())
            .andReturn()
            .getResponse()
            .getContentAsString(), new TypeReference<List<ThrottledSubmission>>() {
        });
        assertFalse(records.isEmpty());

        mockMvc.perform(delete("/actuator/throttles")
                .contentType(MediaType.APPLICATION_JSON)
                .accept(MediaType.APPLICATION_JSON)
                .queryParam("key", records.getFirst().getKey())
            )
            .andExpect(status().isOk());

        mockMvc.perform(delete("/actuator/throttles")
                .contentType(MediaType.APPLICATION_JSON)
                .accept(MediaType.APPLICATION_JSON)
                .queryParam("clear", "true")
            )
            .andExpect(status().isOk());

        mockMvc.perform(delete("/actuator/throttles")
                .contentType(MediaType.APPLICATION_JSON)
                .accept(MediaType.APPLICATION_JSON)
                .queryParam("clear", "false")
            )
            .andExpect(status().isOk());
    }
This is {@link ThrottledSubmissionHandlerEndpointTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-throttle/src/test/java/org/apereo/cas/web/support/ThrottledSubmissionHandlerEndpointTests.java