use of org.entando.entando.aps.system.services.user.model.UserDtoBuilder 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;
}
Aggregations