use of com.agiletec.aps.system.services.user.MockUser in project entando-core by entando.
the class TestAuthorizationManager method addUserForTest.
private void addUserForTest(String username, String password) throws Throwable {
MockUser user = new MockUser();
user.setUsername(username);
user.setPassword(password);
user.setDisabled(false);
Authorization auth = new Authorization(this._groupManager.getGroup(Group.FREE_GROUP_NAME), this._roleManager.getRole("editor"));
user.addAuthorization(auth);
this._userManager.removeUser(user);
UserDetails extractedUser = this._userManager.getUser(username);
assertNull(extractedUser);
this._userManager.addUser(user);
this._authorizationManager.addUserAuthorization(username, auth);
}
use of com.agiletec.aps.system.services.user.MockUser in project entando-core by entando.
the class TestDataObjectAuthorization method addUserForTest.
private void addUserForTest(String username, String password) throws Throwable {
MockUser user = new MockUser();
user.setUsername(username);
user.setPassword(password);
user.setDisabled(false);
Authorization auth = new Authorization(this._groupManager.getGroup(Group.FREE_GROUP_NAME), this._roleManager.getRole("editor"));
user.addAuthorization(auth);
this._userManager.removeUser(user);
UserDetails extractedUser = _userManager.getUser(username);
assertNull(extractedUser);
this._userManager.addUser(user);
this._authorizationManager.addUserAuthorization(username, auth);
}
use of com.agiletec.aps.system.services.user.MockUser in project entando-core by entando.
the class TestContentAuthorization method addUserForTest.
private void addUserForTest(String username, String password) throws Throwable {
MockUser user = new MockUser();
user.setUsername(username);
user.setPassword(password);
user.setDisabled(false);
Authorization auth = new Authorization(this._groupManager.getGroup(Group.FREE_GROUP_NAME), this._roleManager.getRole("editor"));
user.addAuthorization(auth);
this._userManager.removeUser(user);
UserDetails extractedUser = _userManager.getUser(username);
assertNull(extractedUser);
this._userManager.addUser(user);
this._authorizationManager.addUserAuthorization(username, auth);
}
Aggregations