use of com.enonic.xp.security.UpdateGroupParams in project xp by enonic.
the class SecurityServiceImplTest method testUpdateGroup.
@Test
public void testUpdateGroup() throws Exception {
runAsAdmin(() -> {
final CreateGroupParams createGroup = CreateGroupParams.create().groupKey(PrincipalKey.ofGroup(SYSTEM, "Group-a")).displayName("Group A").build();
final Group group = securityService.createGroup(createGroup);
refresh();
final UpdateGroupParams groupUpdate = UpdateGroupParams.create(group).displayName("___Group B___").description("description").build();
final Group updatedGroupResult = securityService.updateGroup(groupUpdate);
refresh();
final Group updatedGroup = securityService.getGroup(group.getKey()).get();
assertEquals("___Group B___", updatedGroupResult.getDisplayName());
assertEquals("___Group B___", updatedGroup.getDisplayName());
assertEquals("description", updatedGroupResult.getDescription());
assertEquals("description", updatedGroup.getDescription());
});
}
Aggregations