-
Notifications
You must be signed in to change notification settings - Fork 4
[CDX-270] Java Fix Now Parameter Tests #169
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
Conversation
VincentGalloro
left a comment
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.
LGTM
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.
Pull Request Overview
This PR fixes Java test cases to properly validate that the now parameter in API responses is returned as an ISO8601 formatted date string instead of a Unix timestamp.
- Updates test assertions to expect ISO8601 date format instead of Unix timestamp format
- Replaces DecimalFormat-based assertion with direct string comparison
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ConstructorIOSearchTest.java | Updates search test to assert ISO8601 formatted now parameter |
| ConstructorIOBrowseTest.java | Updates browse test to assert ISO8601 formatted now parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| UserInfo userInfo = new UserInfo(3, "c62a-2a09-faie"); | ||
| SearchRequest request = new SearchRequest("Jacket"); | ||
| String now = "1659053211"; | ||
| String returnedNow = "2022-07-29T00:06:51+00:00"; |
Copilot
AI
Oct 13, 2025
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.
The hardcoded ISO8601 timestamp creates a brittle test that will fail if the API returns a different but valid timestamp. Consider using a pattern matcher or date parsing to validate the ISO8601 format instead of exact string comparison.
| UserInfo userInfo = new UserInfo(3, "c62a-2a09-faie"); | ||
| BrowseRequest request = new BrowseRequest("Brand", "XYZ"); | ||
| String now = "1659053211"; | ||
| String returnedNow = "2022-07-29T00:06:51+00:00"; |
Copilot
AI
Oct 13, 2025
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.
The hardcoded ISO8601 timestamp creates a brittle test that will fail if the API returns a different but valid timestamp. Consider using a pattern matcher or date parsing to validate the ISO8601 format instead of exact string comparison.
Defect: CDX-270
This fix updates the test to assert that the now parameter in the response is a ISO8601 formatted date string.