Skip to content

Add rejected address verification test fixture#40

Merged
Fivell merged 2 commits intomainfrom
test/rejected-verification-fixture
Mar 11, 2026
Merged

Add rejected address verification test fixture#40
Fivell merged 2 commits intomainfrom
test/rejected-verification-fixture

Conversation

@Fivell
Copy link
Member

@Fivell Fivell commented Mar 10, 2026

Summary

  • Added fixture and test for rejected address verification
  • Tests reject_reasons string field

Test plan

  • All tests pass

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.json fixture representing a rejected address verification payload.
  • Added testFindRejectedAddressVerification to assert status=REJECTED and rejectReasons parsing.

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.

@Fivell Fivell force-pushed the test/rejected-verification-fixture branch from c1ff599 to ce36e4f Compare March 11, 2026 00:00
@Fivell Fivell force-pushed the test/rejected-verification-fixture branch from ce36e4f to 72fb48a Compare March 11, 2026 00:16
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +76 to 81
public List<String> getRejectReasons() {
if (rejectReasons == null) {
return Collections.emptyList();
}
return Arrays.asList(rejectReasons.split("; "));
}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +80
public List<String> getRejectReasons() {
if (rejectReasons == null) {
return Collections.emptyList();
}
return Arrays.asList(rejectReasons.split("; "));
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +76 to +77
public List<String> getRejectReasons() {
if (rejectReasons == null) {
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
public List<String> getRejectReasons() {
if (rejectReasons == null) {
public String getRejectReasons() {
return rejectReasons;
}
public List<String> getRejectReasonsList() {
if (rejectReasons == null || rejectReasons.isEmpty()) {

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@Fivell Fivell merged commit 025f0fb into main Mar 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants