Search in sources :

Example 1 with IterableSource

use of org.mapstruct.ap.test.builtin.source.IterableSource in project mapstruct by mapstruct.

the class BuiltInTest method shouldApplyBuiltInOnIterable.

@ProcessorTest
@WithClasses(IterableSourceTargetMapper.class)
public void shouldApplyBuiltInOnIterable() throws DatatypeConfigurationException {
    IterableSource source = new IterableSource();
    source.setDates(Arrays.asList(createXmlCal(1999, 3, 2, 60)));
    source.publicDates = Arrays.asList(createXmlCal(2016, 3, 2, 60));
    IterableTarget target = IterableSourceTargetMapper.INSTANCE.sourceToTarget(source);
    assertThat(target).isNotNull();
    assertThat(target.getDates()).containsExactly("02.03.1999");
    assertThat(target.publicDates).containsExactly("02.03.2016");
}
Also used : IterableSource(org.mapstruct.ap.test.builtin.source.IterableSource) IterableTarget(org.mapstruct.ap.test.builtin._target.IterableTarget) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest) WithClasses(org.mapstruct.ap.testutil.WithClasses)

Aggregations

IterableTarget (org.mapstruct.ap.test.builtin._target.IterableTarget)1 IterableSource (org.mapstruct.ap.test.builtin.source.IterableSource)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1 WithClasses (org.mapstruct.ap.testutil.WithClasses)1