Search in sources :

Example 1 with XmlGregorianCalendarFactorizedProperty

use of org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarFactorizedProperty in project mapstruct by mapstruct.

the class DatatypeFactoryTest method testNoConflictsWithOwnDatatypeFactory.

@ProcessorTest
public void testNoConflictsWithOwnDatatypeFactory() throws ParseException {
    DateProperty source1 = new DateProperty();
    source1.setProp(createDate("31-08-1982 10:20:56"));
    CalendarProperty source2 = new CalendarProperty();
    source2.setProp(createCalendar("02.03.1999"));
    XmlGregorianCalendarFactorizedProperty target1 = ToXmlGregCalMapper.INSTANCE.map(source1);
    assertThat(target1).isNotNull();
    assertThat(target1.getProp()).isNotNull();
    assertThat(target1.getProp().toString()).isEqualTo("1982-08-31T10:20:56.000+02:00");
    XmlGregorianCalendarFactorizedProperty target2 = ToXmlGregCalMapper.INSTANCE.map(source2);
    assertThat(target2).isNotNull();
    assertThat(target2.getProp()).isNotNull();
    assertThat(target2.getProp().toString()).isEqualTo("1999-03-02T00:00:00.000+01:00");
}
Also used : CalendarProperty(org.mapstruct.ap.test.builtin.bean.CalendarProperty) XmlGregorianCalendarFactorizedProperty(org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarFactorizedProperty) DateProperty(org.mapstruct.ap.test.builtin.bean.DateProperty) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

CalendarProperty (org.mapstruct.ap.test.builtin.bean.CalendarProperty)1 DateProperty (org.mapstruct.ap.test.builtin.bean.DateProperty)1 XmlGregorianCalendarFactorizedProperty (org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarFactorizedProperty)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1