Skip to content

Commit 9d3de8c

Browse files
committed
Add failing test for #1231
1 parent 2cf2870 commit 9d3de8c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/test/java/com/fasterxml/jackson/databind/ser/TestJsonSerializeAs.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ public Bean1178Wrapper(int count) {
7373
}
7474
}
7575
}
76-
76+
77+
static class Bean1178Holder {
78+
@JsonSerialize(as=Bean1178Abstract.class)
79+
public Bean1178Base value = new Bean1178Impl();
80+
}
81+
7782
/*
7883
/**********************************************************
7984
/* Test methods
@@ -107,4 +112,10 @@ public void testSpecializedContentAs() throws IOException {
107112
assertEquals(aposToQuotes("{'values':[{'a':1,'b':2}]}"),
108113
WRITER.writeValueAsString(new Bean1178Wrapper(1)));
109114
}
115+
116+
// for [databind#1231] (and continuation of [databind#1178])
117+
public void testSpecializedAsIntermediate() throws IOException {
118+
assertEquals(aposToQuotes("{'value':{'a':1,'b':2}}"),
119+
WRITER.writeValueAsString(new Bean1178Holder()));
120+
}
110121
}

0 commit comments

Comments
 (0)