Skip to content

Commit a4cf95e

Browse files
committed
Merge branch '2.19'
2 parents ec3ec7b + 776b6e8 commit a4cf95e

File tree

4 files changed

+64
-133
lines changed

4 files changed

+64
-133
lines changed

datetime/src/test/java/tools/jackson/datatype/jsr310/deser/InstantDeserTest.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ public WrapperWithReadTimestampsAsNanosEnabled() { }
9393

9494
@Test
9595
public void testDeserializationAsFloat01() throws Exception {
96-
assertEquals("The value is not correct.", Instant.ofEpochSecond(0L),
96+
assertEquals(Instant.ofEpochSecond(0L),
9797
READER.readValue("0.000000000"));
9898
}
9999

100100
@Test
101101
public void testDeserializationAsFloat02() throws Exception {
102-
assertEquals("The value is not correct.", Instant.ofEpochSecond(123456789L, 183917322),
102+
assertEquals(Instant.ofEpochSecond(123456789L, 183917322),
103103
READER.readValue("123456789.183917322"));
104104
}
105105

@@ -109,7 +109,7 @@ public void testDeserializationAsFloat03() throws Exception
109109
Instant date = Instant.now();
110110
Instant value = READER.readValue(
111111
DecimalUtils.toDecimal(date.getEpochSecond(), date.getNano()));
112-
assertEquals("The value is not correct.", date, value);
112+
assertEquals(date, value);
113113
}
114114

115115
/**
@@ -232,7 +232,7 @@ public void testDeserializationAsInt01Nanoseconds() throws Exception
232232
Instant value = READER
233233
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
234234
.readValue("0");
235-
assertEquals("The value is not correct.", date, value);
235+
assertEquals(date, value);
236236
}
237237

238238
@Test
@@ -243,7 +243,7 @@ public void testDeserializationAsInt02Nanoseconds() throws Exception
243243
Instant value = READER
244244
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
245245
.readValue(String.valueOf(ts));
246-
assertEquals("The value is not correct.", date, value);
246+
assertEquals(date, value);
247247
}
248248

249249
@Test
@@ -255,7 +255,7 @@ public void testDeserializationAsInt03Nanoseconds() throws Exception
255255
Instant value = READER
256256
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
257257
.readValue(Long.toString(date.getEpochSecond()));
258-
assertEquals("The value is not correct.", date, value);
258+
assertEquals(date, value);
259259
}
260260

261261
@Test
@@ -268,7 +268,7 @@ public void testDeserializationAsInt04Nanoseconds() throws Exception
268268
new WrapperWithReadTimestampsAsNanosEnabled(date);
269269
WrapperWithReadTimestampsAsNanosEnabled actual = reader.readValue(
270270
a2q("{'value':" + date.getEpochSecond() + "}"));
271-
assertEquals("The value is not correct.", expected.value, actual.value);
271+
assertEquals(expected.value, actual.value);
272272
}
273273

274274
/*
@@ -284,7 +284,7 @@ public void testDeserializationAsInt01Milliseconds() throws Exception
284284
Instant value = READER
285285
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
286286
.readValue("0");
287-
assertEquals("The value is not correct.", date, value);
287+
assertEquals(date, value);
288288
}
289289

290290
@Test
@@ -294,7 +294,7 @@ public void testDeserializationAsInt02Milliseconds() throws Exception
294294
Instant value = READER
295295
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
296296
.readValue("123456789422");
297-
assertEquals("The value is not correct.", date, value);
297+
assertEquals(date, value);
298298
}
299299

300300
@Test
@@ -306,7 +306,7 @@ public void testDeserializationAsInt03Milliseconds() throws Exception
306306
Instant value = READER
307307
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
308308
.readValue(Long.toString(date.toEpochMilli()));
309-
assertEquals("The value is not correct.", date, value);
309+
assertEquals(date, value);
310310
}
311311

312312
@Test
@@ -319,7 +319,7 @@ public void testDeserializationAsInt04Milliseconds() throws Exception
319319
new WrapperWithReadTimestampsAsNanosDisabled(date);
320320
WrapperWithReadTimestampsAsNanosDisabled actual = reader.readValue(
321321
a2q("{'value':" + date.toEpochMilli() + "}"));
322-
assertEquals("The value is not correct.", expected.value, actual.value);
322+
assertEquals(expected.value, actual.value);
323323
}
324324

325325
/*
@@ -333,15 +333,15 @@ public void testDeserializationAsString01() throws Exception
333333
{
334334
Instant date = Instant.ofEpochSecond(0L);
335335
Instant value = READER.readValue('"' + FORMATTER.format(date) + '"');
336-
assertEquals("The value is not correct.", date, value);
336+
assertEquals(date, value);
337337
}
338338

339339
@Test
340340
public void testDeserializationAsString02() throws Exception
341341
{
342342
Instant date = Instant.ofEpochSecond(123456789L, 183917322);
343343
Instant value = READER.readValue('"' + FORMATTER.format(date) + '"');
344-
assertEquals("The value is not correct.", date, value);
344+
assertEquals(date, value);
345345
}
346346

347347
@Test
@@ -350,7 +350,7 @@ public void testDeserializationAsString03() throws Exception
350350
Instant date = Instant.now();
351351

352352
Instant value = READER.readValue('"' + FORMATTER.format(date) + '"');
353-
assertEquals("The value is not correct.", date, value);
353+
assertEquals(date, value);
354354
}
355355

356356
/*
@@ -370,7 +370,7 @@ public void testDeserializationWithTypeInfo01() throws Exception
370370
"[\"" + Instant.class.getName() + "\",123456789.183917322]", Temporal.class
371371
);
372372
assertTrue("The value should be an Instant.", value instanceof Instant);
373-
assertEquals("The value is not correct.", date, value);
373+
assertEquals(date, value);
374374
}
375375

376376
@Test
@@ -385,7 +385,7 @@ public void testDeserializationWithTypeInfo02() throws Exception
385385
"[\"" + Instant.class.getName() + "\",123456789]", Temporal.class
386386
);
387387
assertTrue("The value should be an Instant.", value instanceof Instant);
388-
assertEquals("The value is not correct.", date, value);
388+
assertEquals(date, value);
389389
}
390390

391391
@Test
@@ -401,7 +401,7 @@ public void testDeserializationWithTypeInfo03() throws Exception
401401
);
402402

403403
assertTrue("The value should be an Instant.", value instanceof Instant);
404-
assertEquals("The value is not correct.", date, value);
404+
assertEquals(date, value);
405405
}
406406

407407
@Test
@@ -415,7 +415,7 @@ public void testDeserializationWithTypeInfo04() throws Exception
415415
"[\"" + Instant.class.getName() + "\",\"" + FORMATTER.format(date) + "\"]", Temporal.class
416416
);
417417
assertTrue("The value should be an Instant.", value instanceof Instant);
418-
assertEquals("The value is not correct.", date, value);
418+
assertEquals(date, value);
419419
}
420420

421421
/*
@@ -468,23 +468,23 @@ public void testDeserializationFromStringWithZeroZoneOffset01() throws Exception
468468
Instant date = Instant.now();
469469
String json = formatWithZeroZoneOffset(date, "+00:00");
470470
Instant result = READER.readValue(json);
471-
assertEquals("The value is not correct.", date, result);
471+
assertEquals(date, result);
472472
}
473473

474474
@Test
475475
public void testDeserializationFromStringWithZeroZoneOffset02() throws Exception {
476476
Instant date = Instant.now();
477477
String json = formatWithZeroZoneOffset(date, "+0000");
478478
Instant result = READER.readValue(json);
479-
assertEquals("The value is not correct.", date, result);
479+
assertEquals(date, result);
480480
}
481481

482482
@Test
483483
public void testDeserializationFromStringWithZeroZoneOffset03() throws Exception {
484484
Instant date = Instant.now();
485485
String json = formatWithZeroZoneOffset(date, "+00");
486486
Instant result = READER.readValue(json);
487-
assertEquals("The value is not correct.", date, result);
487+
assertEquals(date, result);
488488
}
489489

490490
@Test
@@ -493,7 +493,7 @@ public void testDeserializationFromStringWithZeroZoneOffset04() throws Exception
493493
Instant date = Instant.now();
494494
String json = formatWithZeroZoneOffset(date, "+00:30");
495495
Instant result = READER.readValue(json);
496-
assertNotEquals("The value is not correct.", date, result);
496+
assertNotEquals(date, result);
497497
}
498498

499499
@Test
@@ -502,7 +502,7 @@ public void testDeserializationFromStringWithZeroZoneOffset05() throws Exception
502502
Instant date = Instant.now();
503503
String json = formatWithZeroZoneOffset(date, "+01:30");
504504
Instant result = READER.readValue(json);
505-
assertNotEquals("The value is not correct.", date, result);
505+
assertNotEquals(date, result);
506506
}
507507

508508
@Test
@@ -511,7 +511,7 @@ public void testDeserializationFromStringWithZeroZoneOffset06() throws Exception
511511
Instant date = Instant.now();
512512
String json = formatWithZeroZoneOffset(date, "-00:00");
513513
Instant result = READER.readValue(json);
514-
assertEquals("The value is not correct.", date, result);
514+
assertEquals(date, result);
515515
}
516516

517517
private String formatWithZeroZoneOffset(Instant date, String offset){

datetime/src/test/java/tools/jackson/datatype/jsr310/deser/key/ZonedDateTimeKeyDeserializerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public void ZonedDateTime_with_zone_name_can_be_deserialized() throws Exception
3737
assertEquals("2015-07-24T12:23:34.184Z[UTC]", entry.getKey().toString());
3838
}
3939

40+
// 29-Oct-2024, tatu: Following two tests are for Java 8+ only vs Java 9 or later
41+
4042
@Test
4143
public void ZonedDateTime_with_place_name_can_be_deserialized() throws Exception {
4244
assumeFalse(System.getProperty("java.version").startsWith("1.8"));

0 commit comments

Comments
 (0)