@Test
public void deleteExistingUser() throws Exception {

    User userToDelete = _userRepo.findOneByUsername("testuser-editor");
    Assert.assertNotNull(userToDelete);
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    this.mockHttpSession = loginAsAdmin();
    this.mockMvc.perform(delete("/srv/api/users/" + userToDelete.getId())
        .session(this.mockHttpSession)
        .accept(MediaType.parseMediaType("application/json")))
        .andExpect(status().is(204));
    userToDelete = _userRepo.findOneByUsername("testuser-editor");
    Assert.assertNull(userToDelete);
}