Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test issue 4741 #4743

Merged
merged 1 commit into from
Oct 16, 2024
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 @@ -100,6 +100,19 @@ public DefaultIntBean(int i1, Integer i2) {
}
}

@JsonInclude(JsonInclude.Include.NON_DEFAULT)
static class NonDefaultBean4741 {
private String value = null;

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
}

static class NonEmptyString {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String value;
Expand Down Expand Up @@ -318,6 +331,15 @@ public void testIssue1351() throws Exception
mapper.writeValueAsString(new Issue1351NonBean(0)));
}

// [databind#4741]
public void testSerialization4741() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
NonDefaultBean4741 bean = new NonDefaultBean4741();
bean.setValue("");
assertEquals(a2q("{'value':''}"), mapper.writeValueAsString(bean));
}

// [databind#1550]
public void testInclusionOfDate() throws Exception
{
Expand Down