Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"),
Expand Down