@Test public void testWithSeconds() { Date parsed = DateUtil.fromZulu("2011-02-23T14:35:42Z"); Calendar calendar = setupCalendar(); calendar.clear(Calendar.MILLISECOND); Assert.assertEquals(calendar.getTime(), parsed); }
@Test(expected = RuntimeException.class) public void testInvalidDate() { DateUtil.fromZulu("2011-02-23T14:35:42.005"); }
@Test public void testWithMillis() { Date parsed = DateUtil.fromZulu("2011-02-23T14:35:42.005Z"); Assert.assertEquals(setupCalendar().getTime(), parsed); }