use of org.mapstruct.ap.test.builtin.source.MapSource in project mapstruct by mapstruct.
the class BuiltInTest method shouldApplyBuiltInOnMap.
@ProcessorTest
@WithClasses({ MapSourceTargetMapper.class, MapSource.class })
@WithJavaxJaxb
public void shouldApplyBuiltInOnMap() throws DatatypeConfigurationException {
MapSource source = new MapSource();
source.setExample(new HashMap<>());
source.getExample().put(createJaxb("TEST"), createXmlCal(1999, 3, 2, 60));
source.publicExample = new HashMap<>();
source.publicExample.put(createJaxb("TEST"), createXmlCal(2016, 3, 2, 60));
MapTarget target = MapSourceTargetMapper.INSTANCE.sourceToTarget(source);
assertThat(target).isNotNull();
assertThat(target.getExample().get("TEST")).isEqualTo("1999-03-02+01:00");
assertThat(target.publicExample.get("TEST")).isEqualTo("2016-03-02+01:00");
}
Aggregations