@@ -539,15 +539,30 @@ public void timestamp() {
539539 Assert .assertEquals (0 , maxValue .getLow128 ());
540540 Assert .assertEquals (0 , maxValue .getHigh128 ());
541541
542- IllegalArgumentException err1 = Assert .assertThrows (
543- IllegalArgumentException .class , () -> PrimitiveValue .newTimestamp (-1 )
542+ Assert .assertEquals (
543+ "microsSinceEpoch value is before minimum timestamp(1970-01-01 00:00:00.000000): -1" ,
544+ Assert .assertThrows (IllegalArgumentException .class ,
545+ () -> PrimitiveValue .newTimestamp (-1 )
546+ ).getMessage ()
544547 );
545- Assert .assertEquals ("Negative microsSinceEpoch: -1" , err1 .getMessage ());
546-
547- IllegalArgumentException err2 = Assert .assertThrows (
548- IllegalArgumentException .class , () -> PrimitiveValue .newTimestamp (Instant .EPOCH .minusNanos (1 ))
548+ Assert .assertEquals (
549+ "Instant value is before minimum timestamp(1970-01-01 00:00:00.000000): 1969-12-31T23:59:59.999999999Z" ,
550+ Assert .assertThrows (IllegalArgumentException .class ,
551+ () -> PrimitiveValue .newTimestamp (Instant .EPOCH .minusNanos (1 ))
552+ ).getMessage ()
553+ );
554+ Assert .assertEquals (
555+ "microsSinceEpoch value is after maximum timestamp(2105-12-31 23:59:59.999999): 4291747200000000" ,
556+ Assert .assertThrows (IllegalArgumentException .class ,
557+ () -> PrimitiveValue .newTimestamp (4291747200000000l )
558+ ).getMessage ()
559+ );
560+ Assert .assertEquals (
561+ "Instant value is after maximum timestamp(2105-12-31 23:59:59.999999): 2106-01-01T00:00:00Z" ,
562+ Assert .assertThrows (IllegalArgumentException .class ,
563+ () -> PrimitiveValue .newTimestamp (Instant .parse ("2106-01-01T00:00:00.000000Z" ))
564+ ).getMessage ()
549565 );
550- Assert .assertEquals ("Instant before epoch: 1969-12-31T23:59:59.999999999Z" , err2 .getMessage ());
551566 }
552567
553568 @ Test
0 commit comments