Search in sources :

Example 6 with Source

use of org.mapstruct.ap.test.bugs._892.Issue892Mapper.Source 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)

Example 7 with Source

use of org.mapstruct.ap.test.bugs._892.Issue892Mapper.Source in project mapstruct by mapstruct.

the class Issue581Test method shouldMapSourceAndTargetWithTheSameClassName.

@ProcessorTest
public void shouldMapSourceAndTargetWithTheSameClassName() {
    Car source = new Car();
    org.mapstruct.ap.test.bugs._581._target.Car target = SourceTargetMapper.INSTANCE.sourceToTarget(source);
    assertThat(target).isNotNull();
    assertThat(target.getFoo()).isEqualTo(source.getFoo());
}
Also used : Car(org.mapstruct.ap.test.bugs._581.source.Car) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)7 ListAssert (org.assertj.core.api.ListAssert)2 Target (org.mapstruct.ap.test.bugs._1170._target.Target)2 Source (org.mapstruct.ap.test.bugs._1170.source.Source)2 IssueKey (org.mapstruct.ap.testutil.IssueKey)2 WithClasses (org.mapstruct.ap.testutil.WithClasses)2 VehicleDto (org.mapstruct.ap.test.bugs._1269.dto.VehicleDto)1 Vehicle (org.mapstruct.ap.test.bugs._1269.model.Vehicle)1 VehicleImage (org.mapstruct.ap.test.bugs._1269.model.VehicleImage)1 VehicleTypeInfo (org.mapstruct.ap.test.bugs._1269.model.VehicleTypeInfo)1 Source (org.mapstruct.ap.test.bugs._2195.dto.Source)1 TargetBase (org.mapstruct.ap.test.bugs._2195.dto.TargetBase)1 SourceChild (org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.SourceChild)1 TargetChild (org.mapstruct.ap.test.bugs._2318.Issue2318Mapper.TargetChild)1 Car (org.mapstruct.ap.test.bugs._581.source.Car)1 Source (org.mapstruct.ap.test.bugs._892.Issue892Mapper.Source)1 Target (org.mapstruct.ap.test.bugs._892.Issue892Mapper.Target)1