Closed
Description
Rossen Stoyanchev opened SPR-9859 and commented
This is based on the spring-test-mvc project that has been available on Github, as a separate project, for over a year. The project provides a fluent API for performing requests and verifying expectations on the resulting responses. It executes requests using an instance of DispatcherServlet
and passes to it a MockHttpServletRequest
and MockHttpServletResponse
, i.e. without the need for a running a Servlet container.
WebApplicationContext wac = ...;
MockMvc mockMvc = webAppContextSetup(wac).configureWarRootDir("src/main/webapp", false).build()
mockMvc.perform(get("/form"))
.andExpect(status().isOk())
.andExpect(content().mimeType("text/html"))
.andExpect(forwardedUrl("/WEB-INF/layouts/main.jsp"));
Affects: 3.1.2
Issue Links:
- Support loading WebApplicationContexts with the TestContext Framework [SPR-5243] #9917 Support loading WebApplicationContexts with the TestContext Framework
- Add first class support for client-side REST tests [SPR-7951] #12606 Add first class support for client-side REST tests
- Add documentation for the Spring MVC Test support [SPR-9860] #14493 Add documentation for the Spring MVC Test support
- Release 1.0 spring-test-mvc [SPR-9211] #13849 Release 1.0 spring-test-mvc