### Question:
UserMapper implements DataMapper<User, UserDto> { @Override public UserDto mapEntityToDto(User user) { UserDto dto = new UserDto(); dto.setGivenName(user.getGivenName()); dto.setSurname(user.getSurname()); dto.setId(user.getId()); dto.setEmail(user.getMail()); dto.setJobTitle(user.getJobTitle()); dto.setDepartment(user.getDepartment()); dto.setPhoto(user.getPhoto()); logger.info("Mapped User (id: )" + user.getId() + " ) to UserDto"); return dto; } @Autowired  UserMapper(AppEnvironment appEnvironment); @Override User mapDtoToEntity(UserDto dto); @Override UserDto mapEntityToDto(User user); @Override Collection<User> mapDtosToEntities(Collection<UserDto> userDtos); @Override Collection<UserDto> mapEntitiesToDtos(Collection<User> users);  }### Answer:
@Test public void test_mapEntityToDtoShouldMapCorrectly() { userDto1 = userMapper.mapEntityToDto(user1); assertUserWithDto(user1, userDto1); }