assertEquals(testUser.getId(), user.getId());
assertTrue(baseline > 0);
Set<RoleResponseDTO> roles = user.getRoles();
RoleResponseDTO userRole = null;
for (RoleResponseDTO role : roles) {
if (role.getName().equals(Roles.USER_ROLE)) {
userRole = role;
break;
}
}
assertNotNull(userRole);
// remove user role
makeRequest(getUrl() + "/" + user.getId() + "/roles/" + userRole.getId(), "DELETE", null, authToken);
// get user again
url = getUrl() + "/" + testUser.getUsername();
user = jsonToObject(makeRequest(url, "GET", null, authToken), TypeFactory.defaultInstance().constructType(UserResponseDTO.class));