Add rejected address verification test fixture#40
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new rejected AddressVerification API fixture and a corresponding unit test to validate deserialization of the reject_reasons attribute when it is a non-null string.
Changes:
- Added
show_rejected.jsonfixture representing a rejected address verification payload. - Added
testFindRejectedAddressVerificationto assertstatus=REJECTEDandrejectReasonsparsing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/test/resources/fixtures/address_verifications/show_rejected.json |
New fixture response for a rejected address verification, including non-null reject_reasons. |
src/test/java/com/didww/sdk/resource/AddressVerificationTest.java |
New test covering rejected status and rejectReasons field deserialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c1ff599 to
ce36e4f
Compare
ce36e4f to
72fb48a
Compare
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public List<String> getRejectReasons() { | ||
| if (rejectReasons == null) { | ||
| return Collections.emptyList(); | ||
| } | ||
| return Arrays.asList(rejectReasons.split("; ")); | ||
| } |
There was a problem hiding this comment.
getRejectReasons() changes return type from String to List<String> and also changes null behavior (now returns empty list). This is a breaking change for SDK consumers; consider keeping the original String getter (or adding a new method like getRejectReasonsList()/getRejectReasonsParsed() and deprecating the old one) unless a major version bump is intended.
| public List<String> getRejectReasons() { | ||
| if (rejectReasons == null) { | ||
| return Collections.emptyList(); | ||
| } | ||
| return Arrays.asList(rejectReasons.split("; ")); |
There was a problem hiding this comment.
Parsing rejectReasons via split("; ") is brittle: it only works when the API uses exactly semicolon+space, and it will leave leading/trailing whitespace or produce "" entries for empty strings. Prefer splitting on a whitespace-tolerant delimiter (e.g., regex around ;) and trimming/filtering empty segments before returning the list.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public List<String> getRejectReasons() { | ||
| if (rejectReasons == null) { |
There was a problem hiding this comment.
Changing getRejectReasons() from returning String to returning List<String> is a source/binary breaking change for SDK consumers. Consider keeping the original String accessor (e.g., getRejectReasonsRaw() / getRejectReasonsString()), and introducing a new method for the parsed list (or deprecating the old method across a major version bump).
| public List<String> getRejectReasons() { | |
| if (rejectReasons == null) { | |
| public String getRejectReasons() { | |
| return rejectReasons; | |
| } | |
| public List<String> getRejectReasonsList() { | |
| if (rejectReasons == null || rejectReasons.isEmpty()) { |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Summary
Test plan