use of org.mapstruct.ap.test.collection.adder._target.TargetWithoutSetter in project mapstruct by mapstruct.
the class AdderTest method testShouldPreferSetterStrategyButThereIsNone.
@ProcessorTest
public void testShouldPreferSetterStrategyButThereIsNone() throws DogException {
AdderUsageObserver.setUsed(false);
Source source = new Source();
source.setPets(Arrays.asList("mouse"));
TargetWithoutSetter target = SourceTargetMapperStrategySetterPreferred.INSTANCE.toTargetDontUseAdder(source);
assertThat(target).isNotNull();
assertThat(target.getPets().size()).isEqualTo(1);
assertThat(target.getPets().get(0)).isEqualTo(2L);
assertTrue(AdderUsageObserver.isUsed());
}
Aggregations