Search in sources :

Example 1 with SourceInnerClass

use of org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass.SourceInnerClass in project mapstruct by mapstruct.

the class InnerClassesImportsTest method mapperRequiresInnerClassImports.

@ProcessorTest
@IssueKey("412")
public void mapperRequiresInnerClassImports() {
    SourceWithInnerClass source = new SourceWithInnerClass();
    source.setInnerClassMember(new SourceInnerClass(412));
    TargetWithInnerClass target = InnerClassMapper.INSTANCE.sourceToTarget(source);
    assertThat(target).isNotNull();
    assertThat(target.getInnerClassMember().getValue()).isEqualTo(412);
    generatedSource.addComparisonToFixtureFor(InnerClassMapper.class);
}
Also used : SourceWithInnerClass(org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass) SourceInnerClass(org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass.SourceInnerClass) TargetWithInnerClass(org.mapstruct.ap.test.imports.innerclasses.TargetWithInnerClass) IssueKey(org.mapstruct.ap.testutil.IssueKey) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Example 2 with SourceInnerClass

use of org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass.SourceInnerClass in project mapstruct by mapstruct.

the class InnerClassesImportsTest method mapperRequiresInnerInnerClassImports.

@ProcessorTest
@IssueKey("412")
public void mapperRequiresInnerInnerClassImports() {
    SourceInnerClass source = new SourceInnerClass();
    source.setValue(412);
    TargetInnerInnerClass target = InnerClassMapper.INSTANCE.innerSourceToInnerInnerTarget(source);
    assertThat(target).isNotNull();
    assertThat(target.getValue()).isEqualTo(412);
    generatedSource.addComparisonToFixtureFor(InnerClassMapper.class);
}
Also used : SourceInnerClass(org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass.SourceInnerClass) TargetInnerInnerClass(org.mapstruct.ap.test.imports.innerclasses.TargetWithInnerClass.TargetInnerClass.TargetInnerInnerClass) IssueKey(org.mapstruct.ap.testutil.IssueKey) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

SourceInnerClass (org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass.SourceInnerClass)2 IssueKey (org.mapstruct.ap.testutil.IssueKey)2 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)2 SourceWithInnerClass (org.mapstruct.ap.test.imports.innerclasses.SourceWithInnerClass)1 TargetWithInnerClass (org.mapstruct.ap.test.imports.innerclasses.TargetWithInnerClass)1 TargetInnerInnerClass (org.mapstruct.ap.test.imports.innerclasses.TargetWithInnerClass.TargetInnerClass.TargetInnerInnerClass)1