String userId = "test-user-with-empty-role";
String roleId = "empty-role";
RoleIdentifier emptyRole = new RoleIdentifier("default", roleId);
UserManager userManager = this.getUserManager();
User user = userManager.getUser(userId);
assertEquals(3, user.getRoles().size());
assertTrue(user.getRoles().contains(emptyRole));
user.removeRole(emptyRole);
assertEquals(2, user.getRoles().size());
assertFalse(user.getRoles().contains(emptyRole));
userManager.updateUser(user);
Configuration securityModel = this.getSecurityConfiguration();
for (CUserRoleMapping userRoleMapping : securityModel.getUserRoleMappings()) {
if (userId.equals(userRoleMapping.getUserId()) && "default".equals(userRoleMapping.getSource())) {
List<String> configuredRoles = userRoleMapping.getRoles();