use of org.mapstruct.ap.test.imports.sourcewithextendsbound.dto.SpaceshipDto in project mapstruct by mapstruct.
the class SourceTypeContainsCollectionWithExtendsBoundTest method generatesImportsForCollectionWithExtendsBoundInSourceType.
@ProcessorTest
@IssueKey("768")
public void generatesImportsForCollectionWithExtendsBoundInSourceType() {
Astronaut astronaut = new Astronaut();
astronaut.setName("Bob");
Spaceship spaceship = new Spaceship();
spaceship.setAstronauts(Collections.singleton(astronaut));
SpaceshipDto spaceshipDto = SpaceshipMapper.INSTANCE.spaceshipToDto(spaceship);
assertThat(spaceshipDto).isNotNull();
assertThat(spaceshipDto.getAstronauts()).extracting("name").containsOnly("Bob");
generatedSource.forMapper(SpaceshipMapper.class).containsImportFor(Astronaut.class);
generatedSource.forMapper(SpaceshipMapper.class).containsImportFor(Spaceship.class);
generatedSource.forMapper(SpaceshipMapper.class).containsImportFor(AstronautDto.class);
generatedSource.forMapper(SpaceshipMapper.class).containsImportFor(SpaceshipDto.class);
}
Aggregations