child.getRAttrTemplates().add("icon");
child.getAttrs().add(attributeTO("icon", "childIcon"));
child = createRole(child);
assertEquals("childIcon", child.getAttrMap().get("icon").getValues().get(0));
final RoleMod roleChildMod = new RoleMod();
roleChildMod.setId(child.getId());
roleChildMod.setInheritAttributes(Boolean.TRUE);
updateRole(roleChildMod);
child = roleService.read(child.getId());
assertNotNull(child);
assertNotNull(child.getAttrMap().get("icon").getValues());
assertEquals("parentIcon", child.getAttrMap().get("icon").getValues().get(0));
final RoleMod roleParentMod = new RoleMod();
roleParentMod.setId(parent.getId());
roleParentMod.setInheritAttributes(Boolean.TRUE);
updateRole(roleParentMod);
child = roleService.read(child.getId());
assertNotNull(child);
assertNotNull(child.getAttrMap().get("icon").getValues());
assertEquals("ancestorIcon", child.getAttrMap().get("icon").getValues().get(0));
parent = roleService.read(parent.getId());
assertNotNull(parent);
assertNotNull(parent.getAttrMap().get("icon").getValues());
assertEquals("ancestorIcon", parent.getAttrMap().get("icon").getValues().get(0));
roleParentMod.setInheritAttributes(Boolean.FALSE);
updateRole(roleParentMod);
child = roleService.read(child.getId());
assertNotNull(child);
assertNotNull(child.getAttrMap().get("icon").getValues());