Skip to content

Commit 776b6e8

Browse files
committed
Merge branch '2.18' into 2.19
2 parents 97b98e6 + 646b6fe commit 776b6e8

File tree

4 files changed

+64
-133
lines changed

4 files changed

+64
-133
lines changed

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserTest.java

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

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

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

@@ -107,7 +107,7 @@ public void testDeserializationAsFloat03() throws Exception
107107
Instant date = Instant.now();
108108
Instant value = READER.readValue(
109109
DecimalUtils.toDecimal(date.getEpochSecond(), date.getNano()));
110-
assertEquals("The value is not correct.", date, value);
110+
assertEquals(date, value);
111111
}
112112

113113
/**
@@ -230,7 +230,7 @@ public void testDeserializationAsInt01Nanoseconds() throws Exception
230230
Instant value = READER
231231
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
232232
.readValue("0");
233-
assertEquals("The value is not correct.", date, value);
233+
assertEquals(date, value);
234234
}
235235

236236
@Test
@@ -241,7 +241,7 @@ public void testDeserializationAsInt02Nanoseconds() throws Exception
241241
Instant value = READER
242242
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
243243
.readValue(String.valueOf(ts));
244-
assertEquals("The value is not correct.", date, value);
244+
assertEquals(date, value);
245245
}
246246

247247
@Test
@@ -253,7 +253,7 @@ public void testDeserializationAsInt03Nanoseconds() throws Exception
253253
Instant value = READER
254254
.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
255255
.readValue(Long.toString(date.getEpochSecond()));
256-
assertEquals("The value is not correct.", date, value);
256+
assertEquals(date, value);
257257
}
258258

259259
@Test
@@ -266,7 +266,7 @@ public void testDeserializationAsInt04Nanoseconds() throws Exception
266266
new WrapperWithReadTimestampsAsNanosEnabled(date);
267267
WrapperWithReadTimestampsAsNanosEnabled actual = reader.readValue(
268268
a2q("{'value':" + date.getEpochSecond() + "}"));
269-
assertEquals("The value is not correct.", expected.value, actual.value);
269+
assertEquals(expected.value, actual.value);
270270
}
271271

272272
/*
@@ -282,7 +282,7 @@ public void testDeserializationAsInt01Milliseconds() throws Exception
282282
Instant value = READER
283283
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
284284
.readValue("0");
285-
assertEquals("The value is not correct.", date, value);
285+
assertEquals(date, value);
286286
}
287287

288288
@Test
@@ -292,7 +292,7 @@ public void testDeserializationAsInt02Milliseconds() throws Exception
292292
Instant value = READER
293293
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
294294
.readValue("123456789422");
295-
assertEquals("The value is not correct.", date, value);
295+
assertEquals(date, value);
296296
}
297297

298298
@Test
@@ -304,7 +304,7 @@ public void testDeserializationAsInt03Milliseconds() throws Exception
304304
Instant value = READER
305305
.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
306306
.readValue(Long.toString(date.toEpochMilli()));
307-
assertEquals("The value is not correct.", date, value);
307+
assertEquals(date, value);
308308
}
309309

310310
@Test
@@ -317,7 +317,7 @@ public void testDeserializationAsInt04Milliseconds() throws Exception
317317
new WrapperWithReadTimestampsAsNanosDisabled(date);
318318
WrapperWithReadTimestampsAsNanosDisabled actual = reader.readValue(
319319
a2q("{'value':" + date.toEpochMilli() + "}"));
320-
assertEquals("The value is not correct.", expected.value, actual.value);
320+
assertEquals(expected.value, actual.value);
321321
}
322322

323323
/*
@@ -331,15 +331,15 @@ public void testDeserializationAsString01() throws Exception
331331
{
332332
Instant date = Instant.ofEpochSecond(0L);
333333
Instant value = READER.readValue('"' + FORMATTER.format(date) + '"');
334-
assertEquals("The value is not correct.", date, value);
334+
assertEquals(date, value);
335335
}
336336

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

345345
@Test
@@ -348,7 +348,7 @@ public void testDeserializationAsString03() throws Exception
348348
Instant date = Instant.now();
349349

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

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

373373
@Test
@@ -381,7 +381,7 @@ public void testDeserializationWithTypeInfo02() throws Exception
381381
"[\"" + Instant.class.getName() + "\",123456789]", Temporal.class
382382
);
383383
assertTrue("The value should be an Instant.", value instanceof Instant);
384-
assertEquals("The value is not correct.", date, value);
384+
assertEquals(date, value);
385385
}
386386

387387
@Test
@@ -396,7 +396,7 @@ public void testDeserializationWithTypeInfo03() throws Exception
396396
);
397397

398398
assertTrue("The value should be an Instant.", value instanceof Instant);
399-
assertEquals("The value is not correct.", date, value);
399+
assertEquals(date, value);
400400
}
401401

402402
@Test
@@ -409,7 +409,7 @@ public void testDeserializationWithTypeInfo04() throws Exception
409409
"[\"" + Instant.class.getName() + "\",\"" + FORMATTER.format(date) + "\"]", Temporal.class
410410
);
411411
assertTrue("The value should be an Instant.", value instanceof Instant);
412-
assertEquals("The value is not correct.", date, value);
412+
assertEquals(date, value);
413413
}
414414

415415
/*
@@ -462,23 +462,23 @@ public void testDeserializationFromStringWithZeroZoneOffset01() throws Exception
462462
Instant date = Instant.now();
463463
String json = formatWithZeroZoneOffset(date, "+00:00");
464464
Instant result = READER.readValue(json);
465-
assertEquals("The value is not correct.", date, result);
465+
assertEquals(date, result);
466466
}
467467

468468
@Test
469469
public void testDeserializationFromStringWithZeroZoneOffset02() throws Exception {
470470
Instant date = Instant.now();
471471
String json = formatWithZeroZoneOffset(date, "+0000");
472472
Instant result = READER.readValue(json);
473-
assertEquals("The value is not correct.", date, result);
473+
assertEquals(date, result);
474474
}
475475

476476
@Test
477477
public void testDeserializationFromStringWithZeroZoneOffset03() throws Exception {
478478
Instant date = Instant.now();
479479
String json = formatWithZeroZoneOffset(date, "+00");
480480
Instant result = READER.readValue(json);
481-
assertEquals("The value is not correct.", date, result);
481+
assertEquals(date, result);
482482
}
483483

484484
@Test
@@ -487,7 +487,7 @@ public void testDeserializationFromStringWithZeroZoneOffset04() throws Exception
487487
Instant date = Instant.now();
488488
String json = formatWithZeroZoneOffset(date, "+00:30");
489489
Instant result = READER.readValue(json);
490-
assertNotEquals("The value is not correct.", date, result);
490+
assertNotEquals(date, result);
491491
}
492492

493493
@Test
@@ -496,7 +496,7 @@ public void testDeserializationFromStringWithZeroZoneOffset05() throws Exception
496496
Instant date = Instant.now();
497497
String json = formatWithZeroZoneOffset(date, "+01:30");
498498
Instant result = READER.readValue(json);
499-
assertNotEquals("The value is not correct.", date, result);
499+
assertNotEquals(date, result);
500500
}
501501

502502
@Test
@@ -505,7 +505,7 @@ public void testDeserializationFromStringWithZeroZoneOffset06() throws Exception
505505
Instant date = Instant.now();
506506
String json = formatWithZeroZoneOffset(date, "-00:00");
507507
Instant result = READER.readValue(json);
508-
assertEquals("The value is not correct.", date, result);
508+
assertEquals(date, result);
509509
}
510510

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

datetime/src/test/java/com/fasterxml/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)