@Test
@Ignore
public void testDeleteUser() throws Exception {
// sometimes we fail to delete this... so don't just try it willy nilly.
User user = null;
try {
user = userService.getUser("foobar@nodeable.com");
} catch (UserNotFoundException unfe) {
}
if (user == null) {
user = new User.Builder()
.username("foobar@foo.com")
.password("foobar@foo.com")
.accountLocked(false)
.fullname("Bogus user")
.userStatus(User.UserStatus.ACTIVATED)
.account(testAccount)
.roles(userService.getUserRoles())
.accountOriginator(true)
.alias(UUID.randomUUID().toString())
.build();
user = userService.createUser(user);
}
// create bogus token
applicationManager.getSecurityService().issueAuthenticationToken(user);
//TODO: NFI what this call used to do
// assertNotNull(applicationManager.getSecurityService().findUserTokens(user));
// kill user
String url = getUrl() + "/" + user.getId();
makeRequest(url, "DELETE", null, authToken);
try {
applicationManager.getUserService().getUser(user.getUsername());
fail();
} catch (UserNotFoundException e) {
}
//TODO: NFI what this call used to do