-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] Address verification details lost during deserialization #289
Conversation
- Add unit test to verify AddressVerification deserialization works properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
746b5b2
to
713dbb7
Compare
assertNotNull(address.getVerifications().getZip4().getErrors()); // Should have a error due to second line | ||
assertNotNull(address.getVerifications().getDelivery().getErrors()); | ||
|
||
assertFalse(address.getVerifications().getDelivery().getErrors().isEmpty()); // should have at least one error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: the double negative is hard to read. We should probably be asserting that it is present instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE didn't like that we weren't using this "simplified" way.
Description
Our current setup reuses the
Error
class to represent address verification errors. However, theError
class has a custom deserializer that is being called during typical JSON deserialization in our library. Hard-coded logic inside that deserializer was effectively causing deserialization of the hints for address verification to fail.This PR introduces another custom deserializer, specifically for the
AddressVerification
class that handles deserializing address verification JSON without theError
deserializer getting in the way.Closes #288
Testing
Pull Request Type
Please select the option(s) that are relevant to this PR.