Search in sources :

Example 11 with User

use of com.agiletec.aps.system.services.user.User in project entando-core by entando.

the class TestUserAction method addUser.

private void addUser(String username, String password) throws ApsSystemException {
    User user = new User();
    user.setUsername(username);
    user.setPassword(password);
    this._userManager.addUser(user);
}
Also used : User(com.agiletec.aps.system.services.user.User)

Example 12 with User

use of com.agiletec.aps.system.services.user.User in project entando-core by entando.

the class TestUserProfileAction method init.

private void init() throws Exception {
    try {
        this._profileManager = (IUserProfileManager) this.getService(SystemConstants.USER_PROFILE_MANAGER);
        this._userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
        User user = this.createUserForTest(USERNAME_FOR_TEST);
        this._userManager.addUser(user);
    } catch (Throwable e) {
        throw new Exception(e);
    }
}
Also used : User(com.agiletec.aps.system.services.user.User)

Example 13 with User

use of com.agiletec.aps.system.services.user.User in project entando-core by entando.

the class UserControllerIntegrationTest method createUser.

private UserDetails createUser(int i) {
    User user = new User();
    user.setUsername("user" + i);
    user.setDisabled(false);
    user.setLastAccess(new Date());
    user.setLastPasswordChange(new Date());
    user.setMaxMonthsSinceLastAccess(2);
    user.setMaxMonthsSinceLastPasswordChange(1);
    user.setPassword("password" + i);
    return user;
}
Also used : User(com.agiletec.aps.system.services.user.User) Date(java.util.Date)

Example 14 with User

use of com.agiletec.aps.system.services.user.User in project entando-core by entando.

the class UserControllerUnitTest method mockUsers.

private PagedMetadata<UserDto> mockUsers() {
    List<UserDetails> users = new ArrayList<>();
    User user1 = new User();
    user1.setUsername("admin");
    user1.setDisabled(false);
    user1.setLastAccess(new Date());
    user1.setLastPasswordChange(new Date());
    user1.setMaxMonthsSinceLastAccess(2);
    user1.setMaxMonthsSinceLastPasswordChange(1);
    User user2 = new User();
    user2.setUsername("user2");
    user2.setDisabled(false);
    user2.setLastAccess(new Date());
    user1.setLastPasswordChange(new Date());
    user2.setMaxMonthsSinceLastAccess(2);
    user2.setMaxMonthsSinceLastPasswordChange(1);
    User user3 = new User();
    user3.setUsername("user3");
    user3.setDisabled(false);
    user3.setLastAccess(new Date());
    user3.setLastPasswordChange(new Date());
    user3.setMaxMonthsSinceLastAccess(2);
    user3.setMaxMonthsSinceLastPasswordChange(1);
    users.add(user1);
    users.add(user2);
    users.add(user3);
    List<UserDto> dtoList = new UserDtoBuilder().convert(users);
    SearcherDaoPaginatedResult<UserDetails> result = new SearcherDaoPaginatedResult<>(users.size(), users);
    PagedMetadata<UserDto> pagedMetadata = new PagedMetadata<>(new RestListRequest(), result);
    pagedMetadata.setBody(dtoList);
    return pagedMetadata;
}
Also used : User(com.agiletec.aps.system.services.user.User) PagedMetadata(org.entando.entando.web.common.model.PagedMetadata) UserDto(org.entando.entando.aps.system.services.user.model.UserDto) ArrayList(java.util.ArrayList) RestListRequest(org.entando.entando.web.common.model.RestListRequest) SearcherDaoPaginatedResult(com.agiletec.aps.system.common.model.dao.SearcherDaoPaginatedResult) Date(java.util.Date) UserDetails(com.agiletec.aps.system.services.user.UserDetails) UserDtoBuilder(org.entando.entando.aps.system.services.user.model.UserDtoBuilder)

Example 15 with User

use of com.agiletec.aps.system.services.user.User in project entando-core by entando.

the class OAuth2TestUtils method createMockUser.

public static User createMockUser(String username, String pws) {
    User rawUser = new User();
    rawUser.setUsername(username);
    rawUser.setPassword(pws);
    return rawUser;
}
Also used : User(com.agiletec.aps.system.services.user.User)

Aggregations

User (com.agiletec.aps.system.services.user.User)15 Date (java.util.Date)6 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)2 UserDto (org.entando.entando.aps.system.services.user.model.UserDto)2 SearcherDaoPaginatedResult (com.agiletec.aps.system.common.model.dao.SearcherDaoPaginatedResult)1 Group (com.agiletec.aps.system.services.group.Group)1 Role (com.agiletec.aps.system.services.role.Role)1 UserDetails (com.agiletec.aps.system.services.user.UserDetails)1 ArrayList (java.util.ArrayList)1 UserDtoBuilder (org.entando.entando.aps.system.services.user.model.UserDtoBuilder)1 PagedMetadata (org.entando.entando.web.common.model.PagedMetadata)1 RestListRequest (org.entando.entando.web.common.model.RestListRequest)1