Class MockHttpServletRequest
java.lang.Object
org.apache.commons.chain.web.jakarta.servlet.MockHttpServletRequest
- All Implemented Interfaces:
HttpServletRequest
,ServletRequest
Mock Object for
HttpServletRequest
(Version 2.3)-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected Cookie[]
protected Locale
protected String
protected Principal
protected String
protected String
protected HttpSession
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
ConstructorDescriptionMockHttpServletRequest
(HttpSession session) MockHttpServletRequest
(String contextPath, String servletPath, String pathInfo, String queryString) MockHttpServletRequest
(String contextPath, String servletPath, String pathInfo, String queryString, HttpSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
addParameter
(String name, String value) boolean
authenticate
(HttpServletResponse response) getAttribute
(String name) int
long
Cookie[]
long
getDateHeader
(String name) getHeaders
(String name) int
getIntHeader
(String name) int
getParameter
(String name) String[]
getParameterValues
(String name) getParts()
getRealPath
(String path) Deprecated.int
getRequestDispatcher
(String path) int
getSession
(boolean create) boolean
boolean
boolean
boolean
Deprecated.boolean
boolean
boolean
isSecure()
boolean
isUserInRole
(String role) void
void
logout()
void
removeAttribute
(String name) void
setAttribute
(String name, Object value) void
setCharacterEncoding
(String name) void
setHttpSession
(HttpSession session) void
void
setPathElements
(String contextPath, String servletPath, String pathInfo, String queryString) void
setUserPrincipal
(Principal principal) startAsync
(ServletRequest servletRequest, ServletResponse servletResponse) <T extends HttpUpgradeHandler>
TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Field Details
-
attributes
-
contextPath
-
headers
-
cookies
-
locale
-
parameters
-
pathInfo
-
principal
-
queryString
-
servletPath
-
session
-
-
Constructor Details
-
MockHttpServletRequest
public MockHttpServletRequest() -
MockHttpServletRequest
-
MockHttpServletRequest
public MockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString) -
MockHttpServletRequest
public MockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString, HttpSession session)
-
-
Method Details
-
addHeader
-
addParameter
-
addCookie
-
addCookie
-
setHttpSession
-
setLocale
-
setPathElements
public void setPathElements(String contextPath, String servletPath, String pathInfo, String queryString) -
setUserPrincipal
-
getAuthType
- Specified by:
getAuthType
in interfaceHttpServletRequest
-
getContextPath
- Specified by:
getContextPath
in interfaceHttpServletRequest
-
getCookies
- Specified by:
getCookies
in interfaceHttpServletRequest
-
getDateHeader
- Specified by:
getDateHeader
in interfaceHttpServletRequest
-
getHeader
- Specified by:
getHeader
in interfaceHttpServletRequest
-
getHeaderNames
- Specified by:
getHeaderNames
in interfaceHttpServletRequest
-
getHeaders
- Specified by:
getHeaders
in interfaceHttpServletRequest
-
getIntHeader
- Specified by:
getIntHeader
in interfaceHttpServletRequest
-
getMethod
- Specified by:
getMethod
in interfaceHttpServletRequest
-
getPathInfo
- Specified by:
getPathInfo
in interfaceHttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslated
in interfaceHttpServletRequest
-
getQueryString
- Specified by:
getQueryString
in interfaceHttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUser
in interfaceHttpServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionId
in interfaceHttpServletRequest
-
getRequestURI
- Specified by:
getRequestURI
in interfaceHttpServletRequest
-
getRequestURL
- Specified by:
getRequestURL
in interfaceHttpServletRequest
-
getServletPath
- Specified by:
getServletPath
in interfaceHttpServletRequest
-
getSession
- Specified by:
getSession
in interfaceHttpServletRequest
-
getSession
- Specified by:
getSession
in interfaceHttpServletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfaceHttpServletRequest
-
isRequestedSessionIdFromCookie
- Specified by:
isRequestedSessionIdFromCookie
in interfaceHttpServletRequest
-
isRequestedSessionIdFromUrl
Deprecated.- Specified by:
isRequestedSessionIdFromUrl
in interfaceHttpServletRequest
-
isRequestedSessionIdFromURL
- Specified by:
isRequestedSessionIdFromURL
in interfaceHttpServletRequest
-
isRequestedSessionIdValid
- Specified by:
isRequestedSessionIdValid
in interfaceHttpServletRequest
-
isUserInRole
- Specified by:
isUserInRole
in interfaceHttpServletRequest
-
getAttribute
- Specified by:
getAttribute
in interfaceServletRequest
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfaceServletRequest
-
getContentLength
- Specified by:
getContentLength
in interfaceServletRequest
-
getContentType
- Specified by:
getContentType
in interfaceServletRequest
-
getInputStream
- Specified by:
getInputStream
in interfaceServletRequest
-
getLocale
- Specified by:
getLocale
in interfaceServletRequest
-
getLocales
- Specified by:
getLocales
in interfaceServletRequest
-
getLocalAddr
- Specified by:
getLocalAddr
in interfaceServletRequest
-
getLocalName
- Specified by:
getLocalName
in interfaceServletRequest
-
getLocalPort
- Specified by:
getLocalPort
in interfaceServletRequest
-
getParameter
- Specified by:
getParameter
in interfaceServletRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfaceServletRequest
-
getParameterNames
- Specified by:
getParameterNames
in interfaceServletRequest
-
getParameterValues
- Specified by:
getParameterValues
in interfaceServletRequest
-
getProtocol
- Specified by:
getProtocol
in interfaceServletRequest
-
getReader
- Specified by:
getReader
in interfaceServletRequest
-
getRealPath
Deprecated.- Specified by:
getRealPath
in interfaceServletRequest
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfaceServletRequest
-
getRemoteHost
- Specified by:
getRemoteHost
in interfaceServletRequest
-
getRemotePort
- Specified by:
getRemotePort
in interfaceServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcher
in interfaceServletRequest
-
getScheme
- Specified by:
getScheme
in interfaceServletRequest
-
getServerName
- Specified by:
getServerName
in interfaceServletRequest
-
getServerPort
- Specified by:
getServerPort
in interfaceServletRequest
-
isSecure
- Specified by:
isSecure
in interfaceServletRequest
-
removeAttribute
- Specified by:
removeAttribute
in interfaceServletRequest
-
setAttribute
- Specified by:
setAttribute
in interfaceServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncoding
in interfaceServletRequest
-
getContentLengthLong
- Specified by:
getContentLengthLong
in interfaceServletRequest
-
getServletContext
- Specified by:
getServletContext
in interfaceServletRequest
-
startAsync
- Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
isAsyncStarted
- Specified by:
isAsyncStarted
in interfaceServletRequest
-
isAsyncSupported
- Specified by:
isAsyncSupported
in interfaceServletRequest
-
getAsyncContext
- Specified by:
getAsyncContext
in interfaceServletRequest
-
getDispatcherType
- Specified by:
getDispatcherType
in interfaceServletRequest
-
changeSessionId
- Specified by:
changeSessionId
in interfaceHttpServletRequest
-
authenticate
- Specified by:
authenticate
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
login
- Specified by:
login
in interfaceHttpServletRequest
- Throws:
ServletException
-
logout
- Specified by:
logout
in interfaceHttpServletRequest
- Throws:
ServletException
-
getParts
- Specified by:
getParts
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
getPart
- Specified by:
getPart
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException - Specified by:
upgrade
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-