use of org.mapstruct.ap.test.builtin.jodatime.bean.LocalDateTimeBean in project mapstruct by mapstruct.
the class JodaTimeTest method shouldMapXmlGregorianCalendarWithoutSecondsToLocalDateTime.
@ProcessorTest
@WithClasses(XmlGregorianCalendarToLocalDateTime.class)
public void shouldMapXmlGregorianCalendarWithoutSecondsToLocalDateTime() throws Exception {
XmlGregorianCalendarBean in = new XmlGregorianCalendarBean();
XMLGregorianCalendar xcal = DatatypeFactory.newInstance().newXMLGregorianCalendar();
xcal.setYear(1999);
xcal.setMonth(5);
xcal.setDay(25);
xcal.setHour(23);
xcal.setMinute(34);
xcal.setTimezone(60);
in.setxMLGregorianCalendar(xcal);
LocalDateTimeBean res = XmlGregorianCalendarToLocalDateTime.INSTANCE.toDateTimeBean(in);
assertThat(res.getLocalDateTime().getYear()).isEqualTo(1999);
assertThat(res.getLocalDateTime().getMonthOfYear()).isEqualTo(5);
assertThat(res.getLocalDateTime().getDayOfMonth()).isEqualTo(25);
assertThat(res.getLocalDateTime().getHourOfDay()).isEqualTo(23);
assertThat(res.getLocalDateTime().getMinuteOfHour()).isEqualTo(34);
assertThat(res.getLocalDateTime().getSecondOfMinute()).isEqualTo(0);
assertThat(res.getLocalDateTime().getMillisOfSecond()).isEqualTo(0);
}
Aggregations