Repository navigation
[Bug] Update VID by UIN automation to handle empty response when no records are found #1630
Description
Description
Description
The automation test cases for the Retrieve VID by UIN API need to be updated to align with the backward-compatible API behavior.
API:
GET {{baseUrl}}/idrepository/v1/vid/uin/{{id}}
In the previously released version, when no VID records were found for the provided UIN/ID, the API returned an empty/null response.
A recent IdRepo change modified this behavior to throw an error when no records were found, and the corresponding automation test cases were updated to expect the error response.
However, this change caused a few Resident automation test cases to fail when tested with the latest resident MOSIP ID image. Resident currently expects an empty/null response when no VID record is available, consistent with the previously released IdRepo behavior.
To maintain backward compatibility, the IdRepo change has been reverted. The API will continue to return an empty/null response when no records are found.
Expected Fix
Update the IdRepo automation test cases for:
GET /idrepository/v1/vid/uin/{id}
so that:
- When VID records are available, validate the returned VID details.
- When no VID records are found for the provided ID/UIN, expect an empty/null response instead of expecting an error.
- Update any recently modified automation assertions that currently expect an error for the no-record scenario.
Reason for Change
The API behavior was reverted to maintain backward compatibility with existing consumers, particularly the Resident service, which expects an empty/null response when no VID records are found.
Impact
Current automation test cases that expect an error response for the no-record scenario will fail against the reverted/backward-compatible IdRepo implementation.
Steps to Reproduce
- Deploy/use the IdRepo version where the Retrieve VID by UIN API maintains the previously released/backward-compatible behavior.
- Use a valid UIN/ID for which no VID records are available.
- Send the following request:
GET {{baseUrl}}/idrepository/v1/vid/uin/{{id}} - Observe that the API returns an empty/null response when no VID records are found.
- Run the existing IdRepo automation test case for the same no-record scenario.
- Observe that the automation test fails because it expects an error response, whereas the API now returns an empty/null response.
Expected Behavior
For GET {{baseUrl}}/idrepository/v1/vid/uin/{{id}}, when no VID records are found for the provided UIN/ID, the API should return an empty/null response instead of throwing an error.
The automation test case should be updated to expect and validate this behavior, ensuring compatibility with the previously released IdRepo behavior and existing consumers such as Resident.
Attachment / Evidence / Docs / Screenshots
No response
Root Cause
The automation test was updated to expect an error response when no VID records are found for the given UIN/ID, based on a recent IdRepo behavior change.
However, this IdRepo change was later reverted to maintain backward compatibility, because Resident expects an empty/null response when no VID record exists.
As a result, the automation expectation is now out of sync with the actual API behavior, causing the related test cases to fail.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
End Date
Complexity
Start Date
Original Estimate
Time Tracking
Resolved By
Story Points
Activity