Class MockHttpServletRequest

java.lang.Object
org.springframework.mock.web.MockHttpServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest
Direct Known Subclasses:
MockMultipartHttpServletRequest

public class MockHttpServletRequest extends Object implements HttpServletRequest
Mock implementation of the HttpServletRequest interface.

The default, preferred Locale for the server mocked by this request is Locale.ENGLISH. This value can be changed via addPreferredLocale(java.util.Locale) or setPreferredLocales(java.util.List<java.util.Locale>).

As of Spring Framework 5.0, this set of mocks is designed on a Servlet 4.0 baseline.

Since:
1.0.2
Author:
Juergen Hoeller, Rod Johnson, Rick Evans, Mark Fisher, Chris Beams, Sam Brannen, Brian Clozel