Add serialization tests and code cleanup#53
Merged
Conversation
This is not an API change as 2.3.1 did not have these constructors.
It is sort of pointless to maintain complex toString() methods when we have perfectly good JSON serialization that does a better job.
Contributor
There was a problem hiding this comment.
This is so much nicer than the string concat, and less error prone. Wrong nesting of startObject*/end is as easy to achieve here as the old version, but that is nothing in comparison.
Contributor
There was a problem hiding this comment.
maybe make this class abstract too? I think no instances will be created of this class, but rather its subclasses?
Member
Author
There was a problem hiding this comment.
Woops, good catch. I meant to do that.
In order to do this, I had to make AbstractCityResponse and AbstractCountryResponse public. Also, I added a missing abstract to AbstractRecord and disabled overriding of access modifiers in JsonTest to match the mapper used in production.
Contributor
There was a problem hiding this comment.
Who requires all these 0 args constructors? Is it what he JSON lib wants?
Member
Author
There was a problem hiding this comment.
I don't know of anyone that requires them, but removing them would definitely be a breaking change under Semantic Versioning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds tests for serialization of all the response classes. I also reorganized the constructor params added in #52 to be less random and updated some
toString()methods that were missing fields.