Search in sources :

Example 1 with NotImportedDatatype

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);
}
Also used : Target(org.mapstruct.ap.test.imports.referenced.Target) NotImportedDatatype(org.mapstruct.ap.test.imports.referenced.NotImportedDatatype) GeneratedSource(org.mapstruct.ap.testutil.runner.GeneratedSource) Source(org.mapstruct.ap.test.imports.referenced.Source) IssueKey(org.mapstruct.ap.testutil.IssueKey) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

NotImportedDatatype (org.mapstruct.ap.test.imports.referenced.NotImportedDatatype)1 Source (org.mapstruct.ap.test.imports.referenced.Source)1 Target (org.mapstruct.ap.test.imports.referenced.Target)1 IssueKey (org.mapstruct.ap.testutil.IssueKey)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1 GeneratedSource (org.mapstruct.ap.testutil.runner.GeneratedSource)1