Java org.springframework.mock.web MockHttpServletRequest fields, constructors, methods, implement or subclass

Example usage for Java org.springframework.mock.web MockHttpServletRequest fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.springframework.mock.web MockHttpServletRequest.

The text is from its open source code.

Subclass

org.springframework.mock.web.MockHttpServletRequest has subclasses.
Click this link to see all its subclasses.

Constructor

MockHttpServletRequest()
Create a new MockHttpServletRequest with a default MockServletContext .
MockHttpServletRequest(@Nullable String method, @Nullable String requestURI)
Create a new MockHttpServletRequest with a default MockServletContext .
MockHttpServletRequest(@Nullable ServletContext servletContext)
Create a new MockHttpServletRequest with the supplied ServletContext .
MockHttpServletRequest(@Nullable ServletContext servletContext, @Nullable String method, @Nullable String requestURI)
Create a new MockHttpServletRequest with the supplied ServletContext , method , and requestURI .

Method

voidaddHeader(String name, Object value)
Add an HTTP header entry for the given name.
voidaddParameter(String name, @Nullable String value)
Add a single value for the specified HTTP parameter.
voidaddParameter(String name, String... values)
Add an array of values for the specified HTTP parameter.
voidaddParameters(Map params)
Add all provided parameters without replacing any existing values.
voidaddPreferredLocale(Locale locale)
Add a new preferred locale, before any existing locales.
voidaddUserRole(String role)
ObjectgetAttribute(String name)
EnumerationgetAttributeNames()
StringgetAuthType()
StringgetCharacterEncoding()
intgetContentLength()
StringgetContentType()
StringgetContextPath()
Cookie[]getCookies()
StringgetHeader(String name)
EnumerationgetHeaderNames()
EnumerationgetHeaders(String name)
ServletInputStreamgetInputStream()
StringgetLocalAddr()
LocalegetLocale()
Return the first preferred Locale locale configured in this mock request.
EnumerationgetLocales()
Return an Enumeration enumeration of the preferred Locale locales configured in this mock request.
StringgetLocalName()
intgetLocalPort()
StringgetMethod()
StringgetParameter(String name)
MapgetParameterMap()
EnumerationgetParameterNames()
String[]getParameterValues(String name)
StringgetPathInfo()
StringgetProtocol()
StringgetQueryString()
BufferedReadergetReader()
StringgetRemoteAddr()
intgetRemotePort()
StringgetRequestedSessionId()
StringgetRequestURI()
StringBuffergetRequestURL()
StringgetScheme()
StringgetServerName()
intgetServerPort()
ServletContextgetServletContext()
Return the ServletContext that this request is associated with.
StringgetServletPath()
HttpSessiongetSession()
HttpSessiongetSession(boolean create)
PrincipalgetUserPrincipal()
booleanisSecure()
Return true if the #setSecure secure flag has been set to true or if the #getScheme scheme is https .
voidremoveAllParameters()
Remove all existing parameters.
voidremoveParameter(String name)
Remove already registered values for the specified HTTP parameter, if any.
voidsetAsyncStarted(boolean asyncStarted)
voidsetAttribute(String name, @Nullable Object value)
voidsetAuthType(@Nullable String authType)
voidsetCharacterEncoding(@Nullable String characterEncoding)
voidsetContent(@Nullable byte[] content)
Set the content of the request body as a byte array.
voidsetContentType(@Nullable String contentType)
voidsetContextPath(String contextPath)
voidsetCookies(@Nullable Cookie... cookies)
voidsetDispatcherType(DispatcherType dispatcherType)
voidsetLocalAddr(String localAddr)
voidsetLocalName(String localName)
voidsetLocalPort(int localPort)
voidsetMethod(@Nullable String method)
voidsetParameter(String name, String value)
Set a single value for the specified HTTP parameter.
voidsetParameter(String name, String... values)
Set an array of values for the specified HTTP parameter.
voidsetParameters(Map params)
Set all provided parameters replacing any existing values for the provided parameter names.
voidsetPathInfo(@Nullable String pathInfo)
voidsetProtocol(String protocol)
voidsetQueryString(@Nullable String queryString)
voidsetRemoteAddr(String remoteAddr)
voidsetRemoteHost(String remoteHost)
voidsetRemotePort(int remotePort)
voidsetRemoteUser(@Nullable String remoteUser)
voidsetRequestedSessionId(@Nullable String requestedSessionId)
voidsetRequestURI(@Nullable String requestURI)
voidsetScheme(String scheme)
voidsetSecure(boolean secure)
Set the boolean secure flag indicating whether the mock request was made using a secure channel, such as HTTPS.
voidsetServerName(String serverName)
voidsetServerPort(int serverPort)
voidsetServletPath(String servletPath)
voidsetSession(HttpSession session)
voidsetUserPrincipal(@Nullable Principal userPrincipal)