@Test public void getLocalPositiveOffsetUppercaseMaxDateTime() throws Exception { DateTime result = client.datetimes().getLocalPositiveOffsetUppercaseMaxDateTime(); DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)) .toDateTime(DateTimeZone.UTC); Assert.assertEquals(expected, result); }
@Test public void getLocalNegativeOffsetMinDateTime() throws Exception { DateTime result = client.datetimes().getLocalNegativeOffsetMinDateTime(); DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)) .toDateTime(DateTimeZone.UTC); Assert.assertEquals(expected, result); }
@Test public void getOverflowDate() throws Exception { DateTime result = client.datetimes().getOverflow(); // 9999-12-31T23:59:59.999-14:000 DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)); expected = expected.toDateTime(DateTimeZone.UTC); Assert.assertEquals(expected, result); }
@Test public void getUnderflowDate() throws Exception { try { client.datetimes().getUnderflow(); Assert.assertTrue(false); } catch (Exception exception) { // expected Assert.assertEquals(IllegalFieldValueException.class, exception.getClass()); } }
@Test public void getInvalidDate() throws Exception { try { client.datetimes().getInvalid(); Assert.assertTrue(false); } catch (Exception exception) { // expected Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); } }
@Test public void putLocalPositiveOffsetMaxDateTime() throws Exception { DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)); client.datetimes().putLocalPositiveOffsetMaxDateTime(body); }
@Test public void getUtcUppercaseMaxDateTime() throws Exception { DateTime result = client.datetimes().getUtcUppercaseMaxDateTime(); DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); Assert.assertEquals(expected, result); }
@Test public void putUtcMaxDateTime() throws Exception { DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); client.datetimes().putUtcMaxDateTime(body); }
@Test public void getNull() throws Exception { Assert.assertNull(client.datetimes().getNull()); }
@Test public void putLocalNegativeOffsetMinDateTime() throws Exception { DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)); client.datetimes().putLocalNegativeOffsetMinDateTime(body); }
@Test public void getUtcMinDateTime() throws Exception { DateTime result = client.datetimes().getUtcMinDateTime(); DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); Assert.assertEquals(expected, result); }
@Test public void putUtcMinDateTime() throws Exception { DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); client.datetimes().putUtcMinDateTime(body); }