### Question:
ConfigurationMapper implements DataMapper<Configuration, ConfigurationDto> { @Override public Configuration mapDtoToEntity(ConfigurationDto configurationDto) { Configuration configuration = new Configuration(); configuration.setId(configurationDto.getId()); configuration.setName(configurationDto.getName()); configuration.setValue(configurationDto.getValue()); configuration.setType(configurationDto.getType()); logger.info("Mapped ConfigurationDto (id: )" + configurationDto.getId() + ") to Configuration"); return configuration; }  @Override Configuration mapDtoToEntity(ConfigurationDto configurationDto); @Override ConfigurationDto mapEntityToDto(Configuration configuration); @Override Collection<Configuration> mapDtosToEntities(Collection<ConfigurationDto> input); @Override Collection<ConfigurationDto> mapEntitiesToDtos(Collection<Configuration> configurations);  }### Answer:
@Test public void mapDtoToEntity_expectIdIsMapped() { Long expectedId = 42L; configurationDto.setId(expectedId); configuration = configurationMapper.mapDtoToEntity(configurationDto); Assert.assertEquals(expectedId, configuration.getId()); }
@Test public void mapDtoToEntity_expectNameIsMapped() { String expectedName = "name"; configurationDto.setName(expectedName); configuration = configurationMapper.mapDtoToEntity(configurationDto); Assert.assertEquals(expectedName, configuration.getName()); }
@Test public void mapDtoToEntity_expectValueIsMapped() { String expectedValue = "3"; configurationDto.setValue(expectedValue); configuration = configurationMapper.mapDtoToEntity(configurationDto); Assert.assertEquals(expectedValue, configuration.getValue()); }
@Test public void mapDtoToEntity_expectTypeIsMapped() { String expectedType = "number"; configurationDto.setType(expectedType); configuration = configurationMapper.mapDtoToEntity(configurationDto); Assert.assertEquals(expectedType, configuration.getType()); }