@Test public void testConvertSearchableUser() { SearchableUser searchableUser = Mockito.mock(SearchableUser.class); Mockito.when(searchableUser.getDisplayName()).thenReturn(SEARCHABLE_USER_DISPLAY_NAME); Mockito.when(searchableUser.getEmail()).thenReturn(USER_EMAIL); Mockito.when(searchableUser.getFirstname()).thenReturn(USER_FIRSTNAME); Mockito.when(searchableUser.getId()).thenReturn(USER_ID); Mockito.when(searchableUser.getLastname()).thenReturn(USER_LASTNAME); Mockito.when(searchableUser.getReference()).thenReturn(SEARCHABLE_USER_REFERENCE); User responseUser = userMapper.convert(searchableUser); assertNotNull(responseUser); assertEquals(USER_ID, responseUser.getId()); assertEquals(USER_EMAIL, responseUser.getEmail()); assertEquals(USER_FIRSTNAME, responseUser.getFirstName()); assertEquals(USER_LASTNAME, responseUser.getLastName()); assertEquals(SEARCHABLE_USER_DISPLAY_NAME, responseUser.getDisplayName()); assertEquals(SEARCHABLE_USER_REFERENCE, responseUser.getReference()); }
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);  }