File tree Expand file tree Collapse file tree
google-cloud-clients/google-cloud-core/src/test/java/com/google/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,15 @@ public void testToString() {
178178
179179 @ Test
180180 public void parseTimestamp () {
181+ assertThat (Timestamp .parseTimestamp ("0001-01-01T00:00:00Z" )).isEqualTo (Timestamp .MIN_VALUE );
182+ assertThat (Timestamp .parseTimestamp ("9999-12-31T23:59:59.999999999Z" ))
183+ .isEqualTo (Timestamp .MAX_VALUE );
184+ assertThat (Timestamp .parseTimestamp (TEST_TIME_ISO ))
185+ .isEqualTo (Timestamp .ofTimeSecondsAndNanos (TEST_TIME_SECONDS , 0 ));
186+ }
187+
188+ @ Test
189+ public void parseTimestampWithoutTimeZoneOffset () {
181190 assertThat (Timestamp .parseTimestamp ("0001-01-01T00:00:00" )).isEqualTo (Timestamp .MIN_VALUE );
182191 assertThat (Timestamp .parseTimestamp ("9999-12-31T23:59:59.999999999" ))
183192 .isEqualTo (Timestamp .MAX_VALUE );
@@ -217,6 +226,6 @@ public void comparable() {
217226
218227 @ Test
219228 public void serialization () throws Exception {
220- reserializeAndAssert (Timestamp .parseTimestamp ("9999-12-31T23:59:59.999999999 " ));
229+ reserializeAndAssert (Timestamp .parseTimestamp ("9999-12-31T23:59:59.999999999Z " ));
221230 }
222231}
You can’t perform that action at this time.
0 commit comments