Skip to content

Add serialization tests and code cleanup#53

Merged
oschwald merged 8 commits intomasterfrom
greg/serialization-tests
Dec 21, 2015
Merged

Add serialization tests and code cleanup#53
oschwald merged 8 commits intomasterfrom
greg/serialization-tests

Conversation

@oschwald
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make this class abstract too? I think no instances will be created of this class, but rather its subclasses?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@eilara eilara mentioned this pull request Dec 21, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who requires all these 0 args constructors? Is it what he JSON lib wants?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of anyone that requires them, but removing them would definitely be a breaking change under Semantic Versioning.

@oschwald oschwald merged commit ef491ba into master Dec 21, 2015
@oschwald oschwald deleted the greg/serialization-tests branch January 4, 2016 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants