}
@Test
public void issueSYNCOPE48() {
// Parent role, able to create users with role 1
RoleTO parentRole = new RoleTO();
parentRole.setName("parentAdminRole");
parentRole.addEntitlement("USER_CREATE");
parentRole.addEntitlement("ROLE_1");
parentRole.setParent(1L);
parentRole = restTemplate.postForObject(BASE_URL + "role/create", parentRole, RoleTO.class);
assertNotNull(parentRole);
// Child role, with no entitlements
RoleTO childRole = new RoleTO();
childRole.setName("childAdminRole");
childRole.setParent(parentRole.getId());
childRole = restTemplate.postForObject(BASE_URL + "role/create", childRole, RoleTO.class);
assertNotNull(childRole);
// User with child role, created by admin
UserTO role1Admin = UserTestITCase.getSampleTO("syncope48admin@apache.org");
role1Admin.setPassword("password");
MembershipTO membershipTO = new MembershipTO();
membershipTO.setRoleId(childRole.getId());
role1Admin.addMembership(membershipTO);
role1Admin = restTemplate.postForObject(BASE_URL + "user/create", role1Admin, UserTO.class);
assertNotNull(role1Admin);