Search in sources :

Example 1 with Car

use of org.mapstruct.ap.test.inheritedmappingmethod.source.Car in project mapstruct by mapstruct.

the class InheritedMappingMethodTest method shouldMapUsingUnboundedInheretedMappingMethod.

@ProcessorTest
public void shouldMapUsingUnboundedInheretedMappingMethod() {
    // given
    CarDto bikeDto = new CarDto();
    bikeDto.setHorsepower(130);
    // when
    UnboundMappable<CarDto, Car> instance = CarMapper.INSTANCE;
    Car bike = instance.from(bikeDto);
    // then
    assertThat(bike).isNotNull();
    assertThat(bike.getHorsepower()).isEqualTo(130);
}
Also used : Car(org.mapstruct.ap.test.inheritedmappingmethod.source.Car) FastCar(org.mapstruct.ap.test.inheritedmappingmethod.source.FastCar) CarDto(org.mapstruct.ap.test.inheritedmappingmethod._target.CarDto) FastCarDto(org.mapstruct.ap.test.inheritedmappingmethod._target.FastCarDto) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

CarDto (org.mapstruct.ap.test.inheritedmappingmethod._target.CarDto)1 FastCarDto (org.mapstruct.ap.test.inheritedmappingmethod._target.FastCarDto)1 Car (org.mapstruct.ap.test.inheritedmappingmethod.source.Car)1 FastCar (org.mapstruct.ap.test.inheritedmappingmethod.source.FastCar)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1