This is Jackson 2.2.x.
I have a class implementing JsonSerializable
; there are two methods to implement for this interface, serialize()
and serializeWithType()
.
I want to test {de,}serialization of this class, and I can trigger calls to serialize()
easily; not, however, serializeWithType()
.
The javadoc for this latter method says that this method is called
[...] when additional type information is expected to be included in serialization, for deserialization to use.
I just don't understand what this means...
How do I set up a test environment so that this method be called? Note that the JSON to be serialized can be of any type except object (ie, boolean, number, string, array are all valid types).