MockHttpServletResponse.getDateHeader returns -1 for non-existent header
Includes consistent getDateHeader results in both MockHttpServletResponse variants (spring-test and spring-web)
Issue: SPR-16160
(cherry picked from commit 80a0cf7)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -273,6 +273,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);
|
||||
|
||||
Reference in New Issue
Block a user