HeaderResultMatchers susceptible to slight variations in the date format [SPR-17330] #21864
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
cfloersch opened SPR-17330 and commented
So the server now appears to format HTTP date headers using a single or double digit DAY depending on the time of month. However, the HeaderResultMatchers.dateValue() still uses a two digit DAY zero padded if necessary when doing the matching.
This results in test failing 100% when run between the 1st and 9th of any given month.
Both dates should use the same format. Or better yet the matcher should operate on Date objects rather than formatted strings.
Example build failure
[ERROR] Failures:
[ERROR] SimpleControllerTest.testGetCustomHeader:152 Response header 'Last-Modified' expected:<Wed, 03 Oct 2018 17:56:00 GMT> but was:<Wed, 3 Oct 2018 17:56:00 GMT>
Affects: 5.0.9
Attachments:
Referenced from: commits b89cb20, 658c7f9
Backported to: 5.0.10
The text was updated successfully, but these errors were encountered: