@Test public void testConvertUserEntity() { Instant now = Instant.now(); Date nowDate = Date.from(now); UserEntity userEntity = new UserEntity(); userEntity.setCreatedAt(nowDate); userEntity.setEmail(USER_EMAIL); userEntity.setFirstname(USER_FIRSTNAME); userEntity.setId(USER_ID); userEntity.setLastConnectionAt(nowDate); userEntity.setLastname(USER_LASTNAME); userEntity.setPassword(USER_PASSWORD); userEntity.setPicture(USER_PICTURE); userEntity.setRoles(null); userEntity.setSource(USER_SOURCE); userEntity.setSourceId(USER_SOURCE_ID); userEntity.setStatus(USER_STATUS); userEntity.setUpdatedAt(nowDate); User responseUser = userMapper.convert(userEntity); assertNotNull(responseUser); assertEquals(USER_ID, responseUser.getId()); assertEquals(USER_EMAIL, responseUser.getEmail()); assertEquals(USER_FIRSTNAME, responseUser.getFirstName()); assertEquals(USER_LASTNAME, responseUser.getLastName()); assertEquals(USER_FIRSTNAME + ' ' + USER_LASTNAME, responseUser.getDisplayName()); }
public User convert(UserEntity user) { final User userItem = new User(); userItem.setEmail(user.getEmail()); userItem.setFirstName(user.getFirstname()); userItem.setLastName(user.getLastname()); userItem.setDisplayName(user.getDisplayName()); userItem.setId(user.getId()); userItem.setCustomFields(user.getCustomFields()); return userItem; }
UserMapper { public User convert(UserEntity user) { final User userItem = new User(); userItem.setEmail(user.getEmail()); userItem.setFirstName(user.getFirstname()); userItem.setLastName(user.getLastname()); userItem.setDisplayName(user.getDisplayName()); userItem.setId(user.getId()); userItem.setCustomFields(user.getCustomFields()); return userItem; } }
UserMapper { public User convert(UserEntity user) { final User userItem = new User(); userItem.setEmail(user.getEmail()); userItem.setFirstName(user.getFirstname()); userItem.setLastName(user.getLastname()); userItem.setDisplayName(user.getDisplayName()); userItem.setId(user.getId()); userItem.setCustomFields(user.getCustomFields()); return userItem; }  }
UserMapper { public User convert(UserEntity user) { final User userItem = new User(); userItem.setEmail(user.getEmail()); userItem.setFirstName(user.getFirstname()); userItem.setLastName(user.getLastname()); userItem.setDisplayName(user.getDisplayName()); userItem.setId(user.getId()); userItem.setCustomFields(user.getCustomFields()); return userItem; }  User convert(UserEntity user); User convert(SearchableUser user); NewExternalUserEntity convert(RegisterUserInput input); RegisterUserEntity convert(FinalizeRegistrationInput input); UserLinks computeUserLinks(String basePath, Date updateDate); }
UserMapper { public User convert(UserEntity user) { final User userItem = new User(); userItem.setEmail(user.getEmail()); userItem.setFirstName(user.getFirstname()); userItem.setLastName(user.getLastname()); userItem.setDisplayName(user.getDisplayName()); userItem.setId(user.getId()); userItem.setCustomFields(user.getCustomFields()); return userItem; }  User convert(UserEntity user); User convert(SearchableUser user); NewExternalUserEntity convert(RegisterUserInput input); RegisterUserEntity convert(FinalizeRegistrationInput input); UserLinks computeUserLinks(String basePath, Date updateDate);  }