Skip to content

Commit

Permalink
Start resolving unit test failures wrt defaults changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 5, 2025
1 parent 248d99f commit 528a1f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -944,15 +944,19 @@ public void testInstantPriorToEpochIsEqual() throws Exception
assertEquals(original, deserialized);
}

static class Pojo1 {
public static class Pojo1 {
@JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
public ZonedDateTime t1 = ZonedDateTime.parse("2022-04-27T12:00:00+02:00[Europe/Paris]");

public ZonedDateTime t2 = t1;
}

@Test
public void testShapeInt() throws Exception {
String json1 = newMapper().writeValueAsString(new Pojo1());
String json1 = mapperBuilder()
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.build()
.writeValueAsString(new Pojo1());
assertEquals("{\"t1\":1651053600000,\"t2\":1651053600.000000000}", json1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import tools.jackson.databind.JsonNode;
import tools.jackson.databind.ObjectMapper;

import tools.jackson.databind.SerializationFeature;
import tools.jackson.datatype.jsr310.ModuleTestBase;
import tools.jackson.datatype.jsr310.testutil.failure.JacksonTestFailureExpected;

Expand All @@ -16,16 +16,18 @@
// things (like Instant)
public class InstantViaBigDecimal307Test extends ModuleTestBase
{
static class Wrapper307 {
public static class Wrapper307 {
public Instant value;

public Wrapper307(Instant v) { value = v; }
protected Wrapper307() { }
public Wrapper307() { }
}

private final Instant ISSUED_AT = Instant.ofEpochSecond(1234567890).plusNanos(123456789);

private ObjectMapper MAPPER = newMapper();
private ObjectMapper MAPPER = mapperBuilder()
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.build();

@Test
public void instantViaReadValue() throws Exception {
Expand Down

0 comments on commit 528a1f3

Please sign in to comment.