Search in sources :

Example 1 with TargetHuman

use of org.mapstruct.ap.test.collection.adder._target.TargetHuman in project mapstruct by mapstruct.

the class AdderTest method testShouldPreferHumanSingular.

@ProcessorTest
public void testShouldPreferHumanSingular() {
    AdderUsageObserver.setUsed(false);
    SourceTeeth source = new SourceTeeth();
    source.setTeeth(Arrays.asList("moler"));
    TargetHuman target = SourceTargetMapper.INSTANCE.toTargetHuman(source);
    assertThat(target).isNotNull();
    assertThat(target.getTeeth().size()).isEqualTo(1);
    assertThat(target.getTeeth().get(0)).isEqualTo(3);
    assertTrue(AdderUsageObserver.isUsed());
}
Also used : SourceTeeth(org.mapstruct.ap.test.collection.adder.source.SourceTeeth) TargetHuman(org.mapstruct.ap.test.collection.adder._target.TargetHuman) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

TargetHuman (org.mapstruct.ap.test.collection.adder._target.TargetHuman)1 SourceTeeth (org.mapstruct.ap.test.collection.adder.source.SourceTeeth)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1