Skip to content

HeaderResultMatchers susceptible to slight variations in the date format [SPR-17330] #21864

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions