Assert.assertEquals(user.getFirstName(), "Test");
Assert.assertEquals(user.getLastName(), "User With Empty Role");
Assert.assertEquals(user.getPassword(), "b2a0e378437817cebdf753d7dff3dd75483af9e0");
Assert.assertEquals(user.getStatus(), "active");
CUserRoleMapping mapping = config.readUserRoleMapping("test-user-with-empty-role", "default");
Assert.assertTrue(mapping.getRoles().contains("empty-role"));
Assert.assertTrue(mapping.getRoles().contains("role1"));
Assert.assertTrue(mapping.getRoles().contains("role2"));
Assert.assertEquals(3, mapping.getRoles().size());
// try to update empty role
config.updateUserRoleMapping(mapping);
config.save();
config.clearCache();
// make sure we still have the role mappings
mapping = config.readUserRoleMapping("test-user-with-empty-role", "default");
Assert.assertTrue(mapping.getRoles().contains("empty-role"));
Assert.assertTrue(mapping.getRoles().contains("role1"));
Assert.assertTrue(mapping.getRoles().contains("role2"));
Assert.assertEquals(3, mapping.getRoles().size());
}