assertFalse(roleTO.getAttributes().isEmpty());
}
@Test
public void update() {
RoleTO roleTO = buildRoleTO("latestRole" + getUUIDString());
roleTO = createRole(roleService, roleTO);
assertEquals(1, roleTO.getAttributes().size());
assertNotNull(roleTO.getAccountPolicy());
assertEquals(6L, (long) roleTO.getAccountPolicy());
assertNotNull(roleTO.getPasswordPolicy());
assertEquals(4L, (long) roleTO.getPasswordPolicy());
RoleMod roleMod = new RoleMod();
roleMod.setId(roleTO.getId());
String modName = "finalRole" + getUUIDString();
roleMod.setName(modName);
roleMod.addAttributeToBeUpdated(attributeMod("show", "FALSE"));
// change password policy inheritance
roleMod.setInheritPasswordPolicy(Boolean.FALSE);
roleTO = roleService.update(roleMod.getId(), roleMod);
assertEquals(modName, roleTO.getName());
assertEquals(2, roleTO.getAttributes().size());
// changes ignored because not requested (null ReferenceMod)
assertNotNull(roleTO.getAccountPolicy());
assertEquals(6L, (long) roleTO.getAccountPolicy());
// password policy null because not inherited
assertNull(roleTO.getPasswordPolicy());
}