### Question:
SoapSecurityService extends AbstractService implements SecurityService { @Override public void deleteUser(String sid, long userId) throws Exception { checkAdministrator(sid); if (userId == 1) throw new Exception("You cannot delete the admin user"); try { UserDAO dao = (UserDAO) Context.get().getBean(UserDAO.class); User usr = dao.findById(userId); if (usr.getType() != User.TYPE_DEFAULT) { throw new Exception("You cannot delete user with id " + usr.getId() + " because it is a system user"); } dao.delete(userId); } catch (Throwable t) { log.error(t.getMessage(), t); throw new Exception("Unable to delete the user with id " + userId); } }  @Override WSUser[] listUsers(String sid, String group); @Override WSGroup[] listGroups(String sid); @Override long storeUser(String sid, WSUser user); @Override long storeGroup(String sid, WSGroup group); @Override void deleteUser(String sid, long userId); @Override void deleteGroup(String sid, long groupId); @Override int changePassword(String sid, long userId, String oldPassword, String newPassword); @Override WSUser getUser(String sid, long userId); @Override WSUser getUserByUsername(String sid, String username); @Override WSGroup getGroup(String sid, long groupId);  }### Answer:
@Test public void testDeleteUser() throws Exception { User user = userDao.findById(2); Assert.assertNotNull(user); securityServiceImpl.deleteUser("", user.getId()); user = userDao.findById(2); Assert.assertNull(user); }