use of org.mapstruct.ap.test.imports.referenced.NotImportedDatatype in project mapstruct by mapstruct.
the class ConflictingTypesNamesTest method mapperHasNoUnnecessaryImports.
@ProcessorTest
@IssueKey("178")
public void mapperHasNoUnnecessaryImports() {
Source source = new Source();
source.setNotImported(new NotImportedDatatype(42));
Target target = SourceTargetMapper.INSTANCE.sourceToTarget(source);
assertThat(target).isNotNull();
assertThat(target.getNotImported()).isSameAs(source.getNotImported());
target = SecondSourceTargetMapper.INSTANCE.sourceToTarget(source);
assertThat(target).isNotNull();
assertThat(target.getNotImported()).isSameAs(source.getNotImported());
generatedSource.forMapper(SourceTargetMapper.class).containsNoImportFor(NotImportedDatatype.class);
generatedSource.forMapper(SecondSourceTargetMapper.class).containsNoImportFor(NotImportedDatatype.class);
}
Aggregations