.alias("TheHoneyBadger")
.fullname("Honey Badger")
.password(testUser2Username)
.build());
User user = applicationManager.getUserService().getUser(testUser2.getUsername());
assertFalse(user.isUserLocked());
String url = getUrl() + "/" + testUser2.getId() + "/disable/";
makeRequest(url, "PUT", null, authToken);
user = applicationManager.getUserService().getUser(testUser2.getUsername());
assertTrue(user.isUserLocked());
// user should not be returned in the user account list now.
String response = makeRequest(getPublicApiUrlBase() + "/account/users", "GET", null, authToken);
List<UserResponseDTO> users = jsonToObject(response, TypeFactory.defaultInstance().constructCollectionType(List.class,
UserResponseDTO.class));
assertNotNull(users);
boolean exists = false;
for (UserResponseDTO usr : users) {
if (usr.getUsername().equals(testUser2.getUsername())) {
exists = true;
}
}
assertFalse(exists);
url = getUrl() + "/" + testUser2.getId() + "/enable/";
makeRequest(url, "PUT", null, authToken);
user = applicationManager.getUserService().getUser(testUser2.getUsername());
assertFalse(user.isUserLocked());
// user should be returned in the user account list now.
// user should not be returned in the user account list now.
response = makeRequest(getPublicApiUrlBase() + "/account/users", "GET", null, authToken);
users = jsonToObject(response, TypeFactory.defaultInstance().constructCollectionType(List.class,