|
1 | | -package tools.jackson.databind.format; |
| 1 | +package tools.jackson.databind.tofix; |
2 | 2 |
|
3 | 3 | import java.util.*; |
4 | 4 |
|
|
10 | 10 |
|
11 | 11 | import tools.jackson.databind.*; |
12 | 12 | import tools.jackson.databind.testutil.DatabindTestUtil; |
| 13 | +import tools.jackson.databind.testutil.failure.JacksonTestFailureExpected; |
13 | 14 |
|
14 | 15 | import static org.junit.jupiter.api.Assertions.assertEquals; |
15 | 16 |
|
@@ -68,17 +69,21 @@ public Bean5405Override(int value) { |
68 | 69 |
|
69 | 70 | private final ObjectMapper MAPPER = newJsonMapper(); |
70 | 71 |
|
| 72 | + // [databind#5045]: property overrides for @JsonFormat.shape won't work for Maps |
| 73 | + // 30-Nov-2025, tatu: Something about caching is the issue: if "b" commented out, |
| 74 | + // override appears to work; with "b" not |
| 75 | + @JacksonTestFailureExpected |
71 | 76 | @Test |
72 | | - public void testSerializeAsPOJOViaProperty() throws Exception |
| 77 | + public void serializeAsPOJOViaProperty() throws Exception |
73 | 78 | { |
74 | | - String result = MAPPER.writeValueAsString(new Bean5405Container(1,0,3)); |
| 79 | + String result = MAPPER.writeValueAsString(new Bean5405Container(1,2,3)); |
75 | 80 | assertEquals(a2q( |
76 | | - "{'a':{'extra':13,'empty':false},'c':{'extra':13,'empty':false}}"), |
| 81 | + "{'a':{'extra':13,'empty':false},'b':{'value':2},'c':{'extra':13,'empty':false}}"), |
77 | 82 | result); |
78 | 83 | } |
79 | 84 |
|
80 | 85 | @Test |
81 | | - public void testSerializeNaturalViaOverride() throws Exception |
| 86 | + public void serializeNaturalViaOverride() throws Exception |
82 | 87 | { |
83 | 88 | String result = MAPPER.writeValueAsString(new Bean5405Override(123)); |
84 | 89 | assertEquals(a2q("{'stuff':{'value':123}}"), |
|
0 commit comments