1
1
/*
2
- * Copyright 2002-2008 the original author or authors.
2
+ * Copyright 2002-2010 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
37
37
import org .springframework .mock .web .MockHttpServletResponse ;
38
38
import org .springframework .mock .web .MockServletConfig ;
39
39
import org .springframework .mock .web .MockServletContext ;
40
- import org .springframework .validation .BindException ;
41
40
import org .springframework .web .bind .EscapedErrors ;
42
41
import org .springframework .web .context .ServletConfigAwareBean ;
43
42
import org .springframework .web .context .ServletContextAwareBean ;
@@ -206,9 +205,9 @@ public void testLocaleRequest() throws Exception {
206
205
MockHttpServletRequest request = new MockHttpServletRequest (getServletContext (), "GET" , "/locale.do" );
207
206
request .addPreferredLocale (Locale .CANADA );
208
207
MockHttpServletResponse response = new MockHttpServletResponse ();
209
- assertEquals (98 , simpleDispatcherServlet .getLastModified (request ));
210
208
simpleDispatcherServlet .service (request , response );
211
209
assertTrue ("Not forwarded" , response .getForwardedUrl () == null );
210
+ assertEquals (new Long (98 ), response .getHeader ("Last-Modified" ));
212
211
}
213
212
214
213
public void testUnknownRequest () throws Exception {
@@ -269,7 +268,6 @@ public void testAnotherLocaleRequest() throws Exception {
269
268
request .addPreferredLocale (Locale .CANADA );
270
269
request .addUserRole ("role1" );
271
270
MockHttpServletResponse response = new MockHttpServletResponse ();
272
- assertEquals (99 , complexDispatcherServlet .getLastModified (request ));
273
271
complexDispatcherServlet .service (request , response );
274
272
275
273
assertTrue ("Not forwarded" , response .getForwardedUrl () == null );
@@ -282,6 +280,7 @@ public void testAnotherLocaleRequest() throws Exception {
282
280
assertTrue (request .getAttribute ("test3" ) != null );
283
281
assertTrue (request .getAttribute ("test3x" ) != null );
284
282
assertTrue (request .getAttribute ("test3y" ) != null );
283
+ assertEquals (new Long (99 ), response .getHeader ("Last-Modified" ));
285
284
}
286
285
287
286
public void testExistingMultipartRequest () throws Exception {
@@ -824,6 +823,7 @@ public void testDispatcherServletContextRefresh() throws ServletException {
824
823
servlet .destroy ();
825
824
}
826
825
826
+
827
827
public static class ControllerFromParent implements Controller {
828
828
829
829
public ModelAndView handleRequest (HttpServletRequest request , HttpServletResponse response ) throws Exception {
0 commit comments