@Test
    void verifyGetUser() throws Throwable {
        var person = MAPPER.readValue(mockMvc.perform(get("/actuator/personDirectory/cache/casuser")
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .accept(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk())
            .andReturn()
            .getResponse()
            .getContentAsString(), SimplePersonAttributes.class);
        assertNotNull(person);
        assertEquals("123456789", person.getAttributeValue("phone"));

        mockMvc.perform(delete("/actuator/personDirectory/cache/casuser")
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .accept(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk());

        ATTRIBUTE_DAO.setPerson(new SimplePersonAttributes("casuser", Map.of("phone", List.of("99887766"))));
        
        person = MAPPER.readValue(mockMvc.perform(get("/actuator/personDirectory/cache/casuser")
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .accept(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk())
            .andReturn()
            .getResponse()
            .getContentAsString(), SimplePersonAttributes.class);
        assertNotNull(person);
        assertEquals("99887766", person.getAttributeValue("phone"));
    }
This is {@link CasPersonDirectoryEndpointTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-person-directory/src/test/java/org/apereo/cas/CasPersonDirectoryEndpointTests.java