diff --git a/src/test/java/tools/jackson/databind/tofix/MapFormatShape5405Test.java b/src/test/java/tools/jackson/databind/tofix/MapFormatShape5405Test.java index 1f1155084a..708699f003 100644 --- a/src/test/java/tools/jackson/databind/tofix/MapFormatShape5405Test.java +++ b/src/test/java/tools/jackson/databind/tofix/MapFormatShape5405Test.java @@ -62,25 +62,28 @@ public Bean5405Override(int value) { } /* - /********************************************************** + /********************************************************************** /* Test methods, serialization - /********************************************************** + /********************************************************************** */ - final private ObjectMapper MAPPER = newJsonMapper(); + private final ObjectMapper MAPPER = newJsonMapper(); - // Can't yet use per-property overrides at all, see [databind#5405] + // [databind#5045]: property overrides for @JsonFormat.shape won't work for Maps + // 30-Nov-2025, tatu: Something about caching is the issue: if "b" commented out, + // override appears to work; with "b" not @JacksonTestFailureExpected @Test - public void testSerializeAsPOJOViaProperty() throws Exception + public void serializeAsPOJOViaProperty() throws Exception { - String result = MAPPER.writeValueAsString(new Bean5405Container(1,0,3)); - assertEquals(a2q("{'a':{'extra':13,'empty':false},'c':{'empty':false,'value':3}}"), + String result = MAPPER.writeValueAsString(new Bean5405Container(1,2,3)); + assertEquals(a2q( + "{'a':{'extra':13,'empty':false},'b':{'value':2},'c':{'extra':13,'empty':false}}"), result); } @Test - public void testSerializeNaturalViaOverride() throws Exception + public void serializeNaturalViaOverride() throws Exception { String result = MAPPER.writeValueAsString(new Bean5405Override(123)); assertEquals(a2q("{'stuff':{'value':123}}"),