Class MockHttpServletRequest
java.lang.Object
org.apache.commons.chain.web.javax.servlet.MockHttpServletRequest
- All Implemented Interfaces:
HttpServletRequest,ServletRequest
Mock Object for
HttpServletRequest (Version 2.3)-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Cookie[]protected Localeprotected Stringprotected Principalprotected Stringprotected Stringprotected HttpSessionFields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsConstructorDescriptionMockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString) MockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString, HttpSession session) MockHttpServletRequest(HttpSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidaddParameter(String name, String value) booleanauthenticate(HttpServletResponse response) getAttribute(String name) intlongCookie[]longgetDateHeader(String name) getHeaders(String name) intgetIntHeader(String name) intgetParameter(String name) String[]getParameterValues(String name) getParts()getRealPath(String path) Deprecated.intgetRequestDispatcher(String path) intgetSession(boolean create) booleanbooleanbooleanbooleanDeprecated.booleanbooleanbooleanisSecure()booleanisUserInRole(String role) voidvoidlogout()voidremoveAttribute(String name) voidsetAttribute(String name, Object value) voidsetCharacterEncoding(String name) voidsetHttpSession(HttpSession session) voidvoidsetPathElements(String contextPath, String servletPath, String pathInfo, String queryString) voidsetUserPrincipal(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, waitMethods inherited from interface javax.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:
getAuthTypein interfaceHttpServletRequest
-
getContextPath
- Specified by:
getContextPathin interfaceHttpServletRequest
-
getCookies
- Specified by:
getCookiesin interfaceHttpServletRequest
-
getDateHeader
- Specified by:
getDateHeaderin interfaceHttpServletRequest
-
getHeader
- Specified by:
getHeaderin interfaceHttpServletRequest
-
getHeaderNames
- Specified by:
getHeaderNamesin interfaceHttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfaceHttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfaceHttpServletRequest
-
getMethod
- Specified by:
getMethodin interfaceHttpServletRequest
-
getPathInfo
- Specified by:
getPathInfoin interfaceHttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslatedin interfaceHttpServletRequest
-
getQueryString
- Specified by:
getQueryStringin interfaceHttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUserin interfaceHttpServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfaceHttpServletRequest
-
getRequestURI
- Specified by:
getRequestURIin interfaceHttpServletRequest
-
getRequestURL
- Specified by:
getRequestURLin interfaceHttpServletRequest
-
getServletPath
- Specified by:
getServletPathin interfaceHttpServletRequest
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceHttpServletRequest
-
isRequestedSessionIdFromCookie
- Specified by:
isRequestedSessionIdFromCookiein interfaceHttpServletRequest
-
isRequestedSessionIdFromUrl
Deprecated.- Specified by:
isRequestedSessionIdFromUrlin interfaceHttpServletRequest
-
isRequestedSessionIdFromURL
- Specified by:
isRequestedSessionIdFromURLin interfaceHttpServletRequest
-
isRequestedSessionIdValid
- Specified by:
isRequestedSessionIdValidin interfaceHttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfaceHttpServletRequest
-
getAttribute
- Specified by:
getAttributein interfaceServletRequest
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletRequest
-
getContentLength
- Specified by:
getContentLengthin interfaceServletRequest
-
getContentType
- Specified by:
getContentTypein interfaceServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfaceServletRequest
-
getLocale
- Specified by:
getLocalein interfaceServletRequest
-
getLocales
- Specified by:
getLocalesin interfaceServletRequest
-
getLocalAddr
- Specified by:
getLocalAddrin interfaceServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfaceServletRequest
-
getLocalPort
- Specified by:
getLocalPortin interfaceServletRequest
-
getParameter
- Specified by:
getParameterin interfaceServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfaceServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfaceServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfaceServletRequest
-
getProtocol
- Specified by:
getProtocolin interfaceServletRequest
-
getReader
- Specified by:
getReaderin interfaceServletRequest
-
getRealPath
Deprecated.- Specified by:
getRealPathin interfaceServletRequest
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfaceServletRequest
-
getRemotePort
- Specified by:
getRemotePortin interfaceServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfaceServletRequest
-
getScheme
- Specified by:
getSchemein interfaceServletRequest
-
getServerName
- Specified by:
getServerNamein interfaceServletRequest
-
getServerPort
- Specified by:
getServerPortin interfaceServletRequest
-
isSecure
- Specified by:
isSecurein interfaceServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfaceServletRequest
-
setAttribute
- Specified by:
setAttributein interfaceServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceServletRequest
-
getContentLengthLong
- Specified by:
getContentLengthLongin interfaceServletRequest
-
getServletContext
- Specified by:
getServletContextin interfaceServletRequest
-
startAsync
- Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
isAsyncStarted
- Specified by:
isAsyncStartedin interfaceServletRequest
-
isAsyncSupported
- Specified by:
isAsyncSupportedin interfaceServletRequest
-
getAsyncContext
- Specified by:
getAsyncContextin interfaceServletRequest
-
getDispatcherType
- Specified by:
getDispatcherTypein interfaceServletRequest
-
changeSessionId
- Specified by:
changeSessionIdin interfaceHttpServletRequest
-
authenticate
- Specified by:
authenticatein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
login
- Specified by:
loginin interfaceHttpServletRequest- Throws:
ServletException
-
logout
- Specified by:
logoutin interfaceHttpServletRequest- Throws:
ServletException
-
getParts
- Specified by:
getPartsin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
getPart
- Specified by:
getPartin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException - Specified by:
upgradein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-