Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,14 @@ public void BrowseShouldReturnAResultWithNow() throws Exception {
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";
Copy link

Copilot AI Oct 13, 2025

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.

Copilot uses AI. Check for mistakes.
request.setNow(now);

BrowseResponse response = constructor.browse(request, userInfo);

assertTrue("browse results exist", response.getResponse().getResults().size() >= 0);
assertNotNull("now exists", response.getRequest().get("now"));
assertEquals(now, new DecimalFormat("#").format(response.getRequest().get("now")));
assertEquals(returnedNow, response.getRequest().get("now"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,14 @@ public void SearchShouldReturnAResultWithNow() throws Exception {
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";
Copy link

Copilot AI Oct 13, 2025

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.

Copilot uses AI. Check for mistakes.
request.setNow(now);

SearchResponse response = constructor.search(request, userInfo);

assertTrue("search results exist", response.getResponse().getResults().size() >= 0);
assertNotNull("now exists", response.getRequest().get("now"));
assertEquals(now, new DecimalFormat("#").format(response.getRequest().get("now")));
assertEquals(returnedNow, response.getRequest().get("now"));
}

@Test
Expand Down
Loading