Replace ModelAndViewContainer parameter with Object

This commit is contained in:
Rossen Stoyanchev
2011-04-06 15:30:19 +00:00
parent 3ee6734424
commit ca9a3b4584
21 changed files with 92 additions and 100 deletions

View File

@@ -77,12 +77,12 @@ import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.support.InvocableHandlerMethod;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter;
/**
* A test fixture for higher-level {@link RequestMappingHandlerAdapter} tests.
* A test fixture for higher-level {@link RequestMappingHandlerMethodAdapter} tests.
*
* <p>The aim here is not to test {@link RequestMappingHandlerAdapter} itself nor to exercise
* <p>The aim here is not to test {@link RequestMappingHandlerMethodAdapter} itself nor to exercise
* every {@link Controller @Controller} method feature but to have a place to try any feature
* related to {@link Controller @Controller} invocations. Preferably actual tests should be
* added to the components that provide that respective functionality.
@@ -98,7 +98,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
*/
public class RequestMappingHandlerAdapterIntegrationTests {
private RequestMappingHandlerAdapter handlerAdapter;
private RequestMappingHandlerMethodAdapter handlerAdapter;
private MockHttpServletRequest request;
@@ -109,7 +109,7 @@ public class RequestMappingHandlerAdapterIntegrationTests {
ConfigurableWebBindingInitializer bindingInitializer = new ConfigurableWebBindingInitializer();
bindingInitializer.setValidator(new StubValidator());
this.handlerAdapter = new RequestMappingHandlerAdapter();
this.handlerAdapter = new RequestMappingHandlerMethodAdapter();
this.handlerAdapter.setWebBindingInitializer(bindingInitializer);
this.handlerAdapter.setCustomArgumentResolvers(new WebArgumentResolver[] { new ColorArgumentResolver() });

View File

@@ -30,12 +30,12 @@ import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.context.support.GenericWebApplicationContext;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.support.InvocableHandlerMethod;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter;
/**
* Test fixture for {@link RequestMappingHandlerAdapter} unit tests.
* Test fixture for {@link RequestMappingHandlerMethodAdapter} unit tests.
*
* The tests in this class focus on {@link RequestMappingHandlerAdapter} functionality exclusively.
* The tests in this class focus on {@link RequestMappingHandlerMethodAdapter} functionality exclusively.
* Also see {@link RequestMappingHandlerAdapterIntegrationTests} for higher-level tests invoking
* {@link Controller @Controller} methods.
*
@@ -43,7 +43,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
*/
public class RequestMappingHandlerAdapterTests {
private RequestMappingHandlerAdapter handlerAdapter;
private RequestMappingHandlerMethodAdapter handlerAdapter;
private MockHttpServletRequest request;
@@ -51,7 +51,7 @@ public class RequestMappingHandlerAdapterTests {
@Before
public void setup() throws Exception {
this.handlerAdapter = new RequestMappingHandlerAdapter();
this.handlerAdapter = new RequestMappingHandlerMethodAdapter();
this.handlerAdapter.setApplicationContext(new GenericWebApplicationContext());
this.handlerAdapter.afterPropertiesSet();

View File

@@ -28,8 +28,6 @@ import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.ui.ExtendedModelMap;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.mvc.method.annotation.support.DefaultMethodReturnValueHandler;
/**
* Test fixture for {@link DefaultMethodReturnValueHandler} unit tests.
@@ -42,12 +40,12 @@ public class DefaultMethodReturnValueHandlerTests {
private ServletWebRequest webRequest;
private ModelAndViewContainer<View> mavContainer;
private ModelAndViewContainer mavContainer;
@Before
public void setUp() {
this.handler = new DefaultMethodReturnValueHandler(null);
this.mavContainer = new ModelAndViewContainer<View>(new ExtendedModelMap());
this.mavContainer = new ModelAndViewContainer(new ExtendedModelMap());
this.webRequest = new ServletWebRequest(new MockHttpServletRequest());
}

View File

@@ -45,12 +45,12 @@ public class ViewMethodReturnValueHandlerTests {
private ServletWebRequest webRequest;
private ModelAndViewContainer<View> mavContainer;
private ModelAndViewContainer mavContainer;
@Before
public void setUp() {
this.handler = new ViewMethodReturnValueHandler();
this.mavContainer = new ModelAndViewContainer<View>(new ExtendedModelMap());
this.mavContainer = new ModelAndViewContainer(new ExtendedModelMap());
this.webRequest = new ServletWebRequest(new MockHttpServletRequest());
}