use of org.mapstruct.ap.test.collection.adder.source.SourceTeeth in project mapstruct by mapstruct.
the class AdderTest method testShouldFallBackToDaliSingularInAbsenceOfHumanSingular.
@ProcessorTest
public void testShouldFallBackToDaliSingularInAbsenceOfHumanSingular() {
AdderUsageObserver.setUsed(false);
SourceTeeth source = new SourceTeeth();
source.setTeeth(Arrays.asList("moler"));
TargetDali target = SourceTargetMapper.INSTANCE.toTargetDali(source);
assertThat(target).isNotNull();
assertThat(target.getTeeth().size()).isEqualTo(1);
assertThat(target.getTeeth().get(0)).isEqualTo(3);
assertTrue(AdderUsageObserver.isUsed());
}
use of org.mapstruct.ap.test.collection.adder.source.SourceTeeth in project mapstruct by mapstruct.
the class AdderTest method testshouldFallBackToDaliSingularInAbsenseOfHumanSingular.
@Test
public void testshouldFallBackToDaliSingularInAbsenseOfHumanSingular() {
AdderUsageObserver.setUsed(false);
SourceTeeth source = new SourceTeeth();
source.setTeeth(Arrays.asList("moler"));
TargetDali target = SourceTargetMapper.INSTANCE.toTargetDali(source);
assertThat(target).isNotNull();
assertThat(target.getTeeth().size()).isEqualTo(1);
assertThat(target.getTeeth().get(0)).isEqualTo(3);
assertTrue(AdderUsageObserver.isUsed());
}
use of org.mapstruct.ap.test.collection.adder.source.SourceTeeth 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());
}
Aggregations