use of org.entando.entando.web.user.model.UserAuthority in project entando-core by entando.
the class UserServiceIntegrationTest method testAddAndRemoveUserAuthorities.
@Test
public void testAddAndRemoveUserAuthorities() throws Throwable {
try {
UserAuthoritiesRequest request = new UserAuthoritiesRequest();
UserAuthority auth = new UserAuthority();
auth.setGroup("management");
auth.setRole("pageManager");
request.add(auth);
List<UserAuthorityDto> resp = userService.addUserAuthorities("editorCustomers", request);
assertNotNull(resp);
assertEquals(1, resp.size());
assertEquals("management", resp.get(0).getGroup());
} finally {
UserAuthoritiesRequest request = new UserAuthoritiesRequest();
UserAuthority auth = new UserAuthority();
auth.setGroup("customers");
auth.setRole("editor");
request.add(auth);
List<UserAuthorityDto> resp = userService.addUserAuthorities("editorCustomers", request);
assertNotNull(resp);
assertEquals(1, resp.size());
assertEquals("customers", resp.get(0).getGroup());
}
}
Aggregations