use of org.simbasecurity.dwclient.gateway.representations.SimbaUserR in project simba-os by cegeka.
the class SimbaRoleServiceTest method removeRoleFromUser_WhenRoleIsNull_ThrowsIllegalArgumentException.
@Test
public void removeRoleFromUser_WhenRoleIsNull_ThrowsIllegalArgumentException() throws Exception {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Role cannot be null.");
simbaRoleService.removeRoleFromUser(getValidSSOToken(), null, new SimbaUserR());
}
use of org.simbasecurity.dwclient.gateway.representations.SimbaUserR in project simba-os by cegeka.
the class SimbaRoleServiceTest method addRoleToUser_WhenBothRoleAndUserExist_UserHasRole.
@Test
public void addRoleToUser_WhenBothRoleAndUserExist_UserHasRole() throws Exception {
String anExistingRolename = "simba-manager";
SimbaRoleR simbaRole = simbaRoleService.findRoleByName(getValidSSOToken(), anExistingRolename);
SimbaUserR user = simbaUserService.findUserByName(getValidSSOToken(), DUMMY_TEST_USER);
simbaRoleService.addRoleToUser(getValidSSOToken(), simbaRole, user);
simbaDatabaseRule.assertUserRoleExistsAndCleanUp(DUMMY_TEST_USER, anExistingRolename);
}
Aggregations