类的使用
org.springframework.mock.web.MockHttpServletRequest
使用MockHttpServletRequest的程序包 程序包 说明 org.springframework.mock.web A comprehensive set of Servlet API 4.0 mock objects, targeted at usage with Spring's Web MVC framework.org.springframework.test.web.servlet Contains server-side support for testing Spring MVC applications.org.springframework.test.web.servlet.request Contains built-inRequestBuilder
implementations.org.springframework.test.web.servlet.result Contains built-inResultMatcher
andResultHandler
implementations.org.springframework.mock.web中MockHttpServletRequest的使用
org.springframework.mock.web中MockHttpServletRequest的子类 修饰符和类型 类 说明 class
MockMultipartHttpServletRequest
Mock implementation of theMultipartHttpServletRequest
interface.org.springframework.test.web.servlet中MockHttpServletRequest的使用
返回MockHttpServletRequest的org.springframework.test.web.servlet中的方法 修饰符和类型 方法 说明 MockHttpServletRequest
RequestBuilder. buildRequest(ServletContext servletContext)
Build the request.MockHttpServletRequest
MvcResult. getRequest()
Return the performed request.MockHttpServletRequest
SmartRequestBuilder. postProcessRequest(MockHttpServletRequest request)
Apply request post processing.参数类型为MockHttpServletRequest的org.springframework.test.web.servlet中的方法 修饰符和类型 方法 说明 MockHttpServletRequest
SmartRequestBuilder. postProcessRequest(MockHttpServletRequest request)
Apply request post processing.org.springframework.test.web.servlet.request中MockHttpServletRequest的使用
返回MockHttpServletRequest的org.springframework.test.web.servlet.request中的方法 修饰符和类型 方法 说明 MockHttpServletRequest
MockHttpServletRequestBuilder. buildRequest(ServletContext servletContext)
Build aMockHttpServletRequest
.protected MockHttpServletRequest
MockHttpServletRequestBuilder. createServletRequest(ServletContext servletContext)
Create a newMockHttpServletRequest
based on the suppliedServletContext
.protected MockHttpServletRequest
MockMultipartHttpServletRequestBuilder. createServletRequest(ServletContext servletContext)
Create a newMockMultipartHttpServletRequest
based on the suppliedServletContext
and theMockMultipartFiles
added to this builder.MockHttpServletRequest
MockHttpServletRequestBuilder. postProcessRequest(MockHttpServletRequest request)
MockHttpServletRequest
RequestPostProcessor. postProcessRequest(MockHttpServletRequest request)
Post-process the givenMockHttpServletRequest
after its creation and initialization through aMockHttpServletRequestBuilder
.参数类型为MockHttpServletRequest的org.springframework.test.web.servlet.request中的方法 修饰符和类型 方法 说明 MockHttpServletRequest
MockHttpServletRequestBuilder. postProcessRequest(MockHttpServletRequest request)
MockHttpServletRequest
RequestPostProcessor. postProcessRequest(MockHttpServletRequest request)
Post-process the givenMockHttpServletRequest
after its creation and initialization through aMockHttpServletRequestBuilder
.org.springframework.test.web.servlet.result中MockHttpServletRequest的使用
参数类型为MockHttpServletRequest的org.springframework.test.web.servlet.result中的方法 修饰符和类型 方法 说明 protected MultiValueMap<String,String>
PrintingResultHandler. getParamsMultiValueMap(MockHttpServletRequest request)
protected HttpHeaders
PrintingResultHandler. getRequestHeaders(MockHttpServletRequest request)
protected Map<String,Object>
PrintingResultHandler. getSessionAttributes(MockHttpServletRequest request)
protected void
PrintingResultHandler. printRequest(MockHttpServletRequest request)
Print the request.