Search in sources :

Example 1 with SourceChild

use of org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.SourceChild in project mapstruct by mapstruct.

the class Issue2318Test method shouldMap.

@ProcessorTest
@WithClasses(Issue2318Mapper.class)
public void shouldMap() {
    SourceChild source = new SourceChild();
    source.setValue("From child");
    source.setHolder(new Issue2318Mapper.SourceParent.Holder());
    source.getHolder().setParentValue1("From parent");
    source.getHolder().setParentValue2(12);
    TargetChild target = Issue2318Mapper.INSTANCE.mapChild(source);
    assertThat(target.getParentValue1()).isEqualTo("From parent");
    assertThat(target.getParentValue2()).isEqualTo(12);
    assertThat(target.getChildValue()).isEqualTo("From child");
}
Also used : TargetChild(org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.TargetChild) SourceChild(org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.SourceChild) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest) WithClasses(org.mapstruct.ap.testutil.WithClasses)

Aggregations

SourceChild (org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.SourceChild)1 TargetChild (org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.TargetChild)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1 WithClasses (org.mapstruct.ap.testutil.WithClasses)1