Search in sources :

Example 1 with MappingContext

use of org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.MappingContext in project mapstruct by mapstruct.

the class Issue1124Test method nestedPropertyWithContextCompiles.

@ProcessorTest
public void nestedPropertyWithContextCompiles() {
    Entity entity = new Entity();
    Entity subEntity = new Entity();
    subEntity.setId(42L);
    entity.setEntity(subEntity);
    DTO dto = Mappers.getMapper(Issue1124Mapper.class).map(entity, new MappingContext());
    assertThat(dto.getId()).isEqualTo(42L);
}
Also used : MappingContext(org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.MappingContext) Entity(org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.Entity) DTO(org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.DTO) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

DTO (org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.DTO)1 Entity (org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.Entity)1 MappingContext (org.mapstruct.ap.test.bugs._1124.Issue1124Mapper.MappingContext)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1