@SneakyThrows
@Test
void deleteUserTest() {

    RestDocumentationResultHandler document = document("user-delete-success",
            requestHeaders(
                    headerWithName("token").description(TOKEN_DESCRIPTION),
                    headerWithName("user").description(USER_DESCRIPTION),
                    headerWithName("password").description(PASSWORD_DESCRIPTION)
            ));
    when(dataSafeService.userProfile().userExists(any())).thenReturn(true);
    mvc.perform(delete("/user")
            .contentType(MediaType.APPLICATION_JSON)
            .accept(MediaType.APPLICATION_JSON)
            .header("user", TEST_USER)
            .header("password", TEST_PASS)
            .header("token", token)
    )
            .andExpect(status().isOk())
            .andDo(document);
    verify(userProfile).deregister(any());
}