22
22
23
23
import java .time .Instant ;
24
24
import java .time .ZoneId ;
25
+ import java .time .ZoneOffset ;
25
26
import java .time .ZonedDateTime ;
26
27
import java .time .temporal .ChronoField ;
27
28
import java .time .temporal .ChronoUnit ;
@@ -44,7 +45,7 @@ public class TestZonedDateTimeSerialization extends ModuleTestBase {
44
45
45
46
private static final ZoneId Z3 = ZoneId .of ("America/Los_Angeles" );
46
47
47
- private static final ZoneId UTC = ZoneId . of ( " UTC" ) ;
48
+ private static final ZoneId UTC = ZoneOffset . UTC ;
48
49
49
50
private static final ZoneId DEFAULT_TZ = UTC ;
50
51
@@ -254,7 +255,7 @@ public void testDeserializationAsFloat01WithTimeZone() throws Exception
254
255
255
256
assertNotNull ("The value should not be null." , value );
256
257
assertIsEqual (date , value );
257
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
258
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
258
259
}
259
260
260
261
@ Test
@@ -279,7 +280,7 @@ public void testDeserializationAsFloat02WithTimeZone() throws Exception
279
280
280
281
assertNotNull ("The value should not be null." , value );
281
282
assertIsEqual (date , value );
282
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
283
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
283
284
}
284
285
285
286
@ Test
@@ -308,7 +309,7 @@ public void testDeserializationAsFloat03WithTimeZone() throws Exception
308
309
309
310
assertNotNull ("The value should not be null." , value );
310
311
assertIsEqual (date , value );
311
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
312
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
312
313
}
313
314
314
315
@ Test
@@ -335,7 +336,7 @@ public void testDeserializationAsInt01NanosecondsWithTimeZone() throws Exception
335
336
336
337
assertNotNull ("The value should not be null." , value );
337
338
assertIsEqual (date , value );
338
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
339
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
339
340
}
340
341
341
342
@ Test
@@ -362,7 +363,7 @@ public void testDeserializationAsInt01MillisecondsWithTimeZone() throws Exceptio
362
363
363
364
assertNotNull ("The value should not be null." , value );
364
365
assertIsEqual (date , value );
365
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
366
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
366
367
}
367
368
368
369
@ Test
@@ -389,7 +390,7 @@ public void testDeserializationAsInt02NanosecondsWithTimeZone() throws Exception
389
390
390
391
assertNotNull ("The value should not be null." , value );
391
392
assertIsEqual (date , value );
392
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
393
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
393
394
}
394
395
395
396
@ Test
@@ -416,7 +417,7 @@ public void testDeserializationAsInt02MillisecondsWithTimeZone() throws Exceptio
416
417
417
418
assertNotNull ("The value should not be null." , value );
418
419
assertIsEqual (date , value );
419
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
420
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
420
421
}
421
422
422
423
@ Test
@@ -445,7 +446,7 @@ public void testDeserializationAsInt03NanosecondsWithTimeZone() throws Exception
445
446
446
447
assertNotNull ("The value should not be null." , value );
447
448
assertIsEqual (date , value );
448
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
449
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
449
450
}
450
451
451
452
@ Test
@@ -476,7 +477,7 @@ public void testDeserializationAsInt03MillisecondsWithTimeZone() throws Exceptio
476
477
477
478
assertNotNull ("The value should not be null." , value );
478
479
assertIsEqual (date , value );
479
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
480
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
480
481
}
481
482
482
483
@ Test
@@ -503,7 +504,7 @@ public void testDeserializationAsString01WithTimeZone() throws Exception
503
504
504
505
assertNotNull ("The value should not be null." , value );
505
506
assertIsEqual (date , value );
506
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
507
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
507
508
}
508
509
509
510
@ Test
@@ -544,7 +545,7 @@ public void testDeserializationAsString02WithTimeZone() throws Exception
544
545
545
546
assertNotNull ("The value should not be null." , value );
546
547
assertIsEqual (date , value );
547
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
548
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
548
549
}
549
550
550
551
@ Test
@@ -585,7 +586,7 @@ public void testDeserializationAsString03WithTimeZone() throws Exception
585
586
586
587
assertNotNull ("The value should not be null." , value );
587
588
assertIsEqual (date , value );
588
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), value .getZone ());
589
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , value .getZone ());
589
590
}
590
591
591
592
@ Test
@@ -632,7 +633,7 @@ public void testDeserializationWithTypeInfo01WithTimeZone() throws Exception
632
633
assertNotNull ("The value should not be null." , value );
633
634
assertTrue ("The value should be an ZonedDateTime." , value instanceof ZonedDateTime );
634
635
assertIsEqual (date , (ZonedDateTime ) value );
635
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), ((ZonedDateTime ) value ).getZone ());
636
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , ((ZonedDateTime ) value ).getZone ());
636
637
}
637
638
638
639
@ Test
@@ -667,7 +668,7 @@ public void testDeserializationWithTypeInfo02WithTimeZone() throws Exception
667
668
assertNotNull ("The value should not be null." , value );
668
669
assertTrue ("The value should be an ZonedDateTime." , value instanceof ZonedDateTime );
669
670
assertIsEqual (date , (ZonedDateTime ) value );
670
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), ((ZonedDateTime ) value ).getZone ());
671
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , ((ZonedDateTime ) value ).getZone ());
671
672
}
672
673
673
674
@ Test
@@ -702,7 +703,7 @@ public void testDeserializationWithTypeInfo03WithTimeZone() throws Exception
702
703
assertNotNull ("The value should not be null." , value );
703
704
assertTrue ("The value should be an ZonedDateTime." , value instanceof ZonedDateTime );
704
705
assertIsEqual (date , (ZonedDateTime ) value );
705
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), ((ZonedDateTime ) value ).getZone ());
706
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , ((ZonedDateTime ) value ).getZone ());
706
707
}
707
708
708
709
@ Test
@@ -737,7 +738,7 @@ public void testDeserializationWithTypeInfo04WithTimeZone() throws Exception
737
738
assertNotNull ("The value should not be null." , value );
738
739
assertTrue ("The value should be an ZonedDateTime." , value instanceof ZonedDateTime );
739
740
assertIsEqual (date , (ZonedDateTime ) value );
740
- assertEquals ("The time zone is not correct." , ZoneId .systemDefault (), ((ZonedDateTime ) value ).getZone ());
741
+ assertEquals ("The time zone is not correct." , ZoneId .systemDefault (). normalized () , ((ZonedDateTime ) value ).getZone ());
741
742
}
742
743
743
744
@ Test
0 commit comments