File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
main/java/kentico/kontent/delivery
test/java/kentico/kontent/delivery Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 2424
2525package kentico .kontent .delivery ;
2626
27+ import com .fasterxml .jackson .annotation .JsonIgnore ;
2728import com .fasterxml .jackson .annotation .JsonProperty ;
2829import com .fasterxml .jackson .annotation .JsonSubTypes ;
2930import com .fasterxml .jackson .annotation .JsonTypeInfo ;
@@ -96,6 +97,7 @@ public abstract class Element<T> {
9697 * @param parent the parent to this
9798 * @return the parent to this
9899 */
100+ @ JsonIgnore
99101 ContentItem parent ;
100102
101103 /**
Original file line number Diff line number Diff line change @@ -145,6 +145,19 @@ public void testContentItemDeserialization() throws IOException {
145145
146146 }
147147
148+ @ Test
149+ public void testContentItemSerialization () throws IOException {
150+ ContentItemResponse response = objectMapper .readValue (
151+ this .getClass ().getResource ("SampleContentItem.json" ), ContentItemResponse .class );
152+
153+ String serializedContentItemResponse = objectMapper .writeValueAsString (response );
154+
155+ ContentItemResponse response2 = objectMapper .readValue (
156+ serializedContentItemResponse , ContentItemResponse .class );
157+
158+ Assert .assertEquals (response , response2 );
159+ }
160+
148161 @ Test
149162 public void testContentTypeListDeserialization () throws IOException {
150163 ContentTypesListingResponse response = objectMapper .readValue (
You can’t perform that action at this time.
0 commit comments