@Test
public void unmarshalAllAllowedFormatsTest() throws Exception
{

    RegistrationDateAdapter adapter = new RegistrationDateAdapter();
    // test for pattern: "yyyy-MM-dd"
    XMLGregorianCalendar calendar = adapter.unmarshal("2020-02-02");
    compareCalendarWithExpectedValues(calendar, 2020, 2, 2, 0, 0, 0);
    // test for pattern: "yyyy-MM-dd'T'HH:mm"
    calendar = adapter.unmarshal("2015-12-25T00:01");
    compareCalendarWithExpectedValues(calendar, 2015, 12, 25, 0, 1, 0);
    // test for pattern: "yyyy-MM-dd'T'HH:mmZ"
    calendar = adapter.unmarshal("2015-12-25T00:01+04:00");
    compareCalendarWithExpectedValues(calendar, 2015, 12, 24, 20, 1, 0);
    // test for pattern: "yyyy-MM-dd'T'HH:mm:ss"
    calendar = adapter.unmarshal("2018-02-03T10:00:02");
    compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 10, 0, 2);
    // test for pattern: "yyyy-MM-dd'T'HH:mm:ssZ"
    calendar = adapter.unmarshal("2018-02-03T10:00:02+04:00");
    compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 6, 0, 2);
    // test for pattern: "yyyy-MM-dd HH:mm:ssZ"
    calendar = adapter.unmarshal("2018-02-03 10:00:02+05:30");
    compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 4, 30, 2);
    // test for pattern: "yyyy-MM-dd HH:mm:ss"
    calendar = adapter.unmarshal("2018-03-03 00:20:02");
    compareCalendarWithExpectedValues(calendar, 2018, 3, 3, 0, 20, 2);
}