Skip to content

Commit

Permalink
test issue 4741 (#4743)
Browse files Browse the repository at this point in the history
make test better match issue
  • Loading branch information
pjfanning authored Oct 16, 2024
1 parent b6da0d5 commit c8e577d
Showing 1 changed file with 22 additions and 0 deletions.
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

0 comments on commit c8e577d

Please sign in to comment.