assertTextPresent("groupId is null", ae.getMessage());
}
}
public void testDeleteMembership() {
Group sales = identityService.newGroup("sales");
identityService.saveGroup(sales);
User johndoe = identityService.newUser("johndoe");
identityService.saveUser(johndoe);
// Add membership
identityService.createMembership(johndoe.getId(), sales.getId());
List<Group> groups = identityService.createGroupQuery().groupMember(johndoe.getId()).list();
assertTrue(groups.size() == 1);
assertEquals("sales", groups.get(0).getId());
// Delete the membership and check members of sales group
identityService.deleteMembership(johndoe.getId(), sales.getId());
groups = identityService.createGroupQuery().groupMember(johndoe.getId()).list();
assertTrue(groups.size() == 0);
identityService.deleteGroup("sales");
identityService.deleteUser("johndoe");