MockHttpServletResponse.getDateHeader returns -1 for non-existent header

Includes consistent getDateHeader results in both MockHttpServletResponse variants (spring-test and spring-web)

Issue: SPR-16160
This commit is contained in:
Juergen Hoeller
2017-11-05 16:12:21 +01:00
parent 0edf4d6509
commit 80a0cf71f4
4 changed files with 120 additions and 127 deletions

View File

@@ -291,6 +291,12 @@ public class MockHttpServletResponseTests {
response.getDateHeader("Last-Modified");
}
@Test // SPR-16160
public void getNonExistentDateHeader() {
assertNull(response.getHeader("Last-Modified"));
assertEquals(-1, response.getDateHeader("Last-Modified"));
}
@Test // SPR-10414
public void modifyStatusAfterSendError() throws IOException {
response.sendError(HttpServletResponse.SC_NOT_FOUND);