Package de.cuioss.test.jsf.mocks
Class CuiMockHttpServletRequest
- java.lang.Object
-
- org.apache.myfaces.test.mock.MockHttpServletRequest
-
- de.cuioss.test.jsf.mocks.CuiMockHttpServletRequest
-
- All Implemented Interfaces:
HttpServletRequest,ServletRequest
public class CuiMockHttpServletRequest extends org.apache.myfaces.test.mock.MockHttpServletRequest
ExtendsMockHttpServletRequestand provides some additional convenience methods- Author:
- Oliver Wolff
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVLET_REQUEST_URL"http://localhost:8080/servletRequestUrl/"-
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
-
Constructor Summary
Constructors Constructor Description CuiMockHttpServletRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(HttpServletResponse response)AsyncContextgetAsyncContext()DispatcherTypegetDispatcherType()EnumerationgetLocales()PartgetPart(String name)Collection<Part>getParts()StringBuffergetRequestURL()HttpSessiongetSession(boolean create)getSession should never return an invalidated session.booleanisAsyncStarted()booleanisAsyncSupported()voidlogin(String username, String password)voidlogout()voidsetRequestLocales(List<Locale> requestLocales)voidsetRequestUrl(String requestUrl)AsyncContextstartAsync()AsyncContextstartAsync(ServletRequest request, ServletResponse response)-
Methods inherited from class org.apache.myfaces.test.mock.MockHttpServletRequest
addAttributeListener, addCookie, addDateHeader, addHeader, addIntHeader, addParameter, addUserRole, clearUserRoles, getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocalAddr, getLocale, getLocalName, getLocalPort, getMethod, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathInfo, getPathTranslated, getProtocol, getQueryString, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRemoteUser, getRequestDispatcher, getRequestedSessionId, getRequestURI, getScheme, getServerName, getServerPort, getServletContext, getServletPath, getSession, getUserPrincipal, getWebContainer, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isSecure, isUserInRole, removeAttribute, setAttribute, setCharacterEncoding, setContextPath, setHttpSession, setInputStream, setLocale, setMethod, setPathElements, setPathInfo, setServletContext, setServletPath, setUserPrincipal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.servlet.http.HttpServletRequest
changeSessionId, getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder, upgrade
-
Methods inherited from interface javax.servlet.ServletRequest
getContentLengthLong
-
-
-
-
Field Detail
-
SERVLET_REQUEST_URL
public static final String SERVLET_REQUEST_URL
"http://localhost:8080/servletRequestUrl/"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CuiMockHttpServletRequest
public CuiMockHttpServletRequest()
-
-
Method Detail
-
getLocales
public Enumeration getLocales()
- Specified by:
getLocalesin interfaceServletRequest- Overrides:
getLocalesin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getRequestURL
public StringBuffer getRequestURL()
- Specified by:
getRequestURLin interfaceHttpServletRequest- Overrides:
getRequestURLin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
authenticate
public boolean authenticate(HttpServletResponse response)
- Specified by:
authenticatein interfaceHttpServletRequest- Overrides:
authenticatein classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getPart
public Part getPart(String name)
- Specified by:
getPartin interfaceHttpServletRequest- Overrides:
getPartin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getParts
public Collection<Part> getParts()
- Specified by:
getPartsin interfaceHttpServletRequest- Overrides:
getPartsin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
login
public void login(String username, String password)
- Specified by:
loginin interfaceHttpServletRequest- Overrides:
loginin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
logout
public void logout()
- Specified by:
logoutin interfaceHttpServletRequest- Overrides:
logoutin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getAsyncContext
public AsyncContext getAsyncContext()
- Specified by:
getAsyncContextin interfaceServletRequest- Overrides:
getAsyncContextin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getDispatcherType
public DispatcherType getDispatcherType()
- Specified by:
getDispatcherTypein interfaceServletRequest- Overrides:
getDispatcherTypein classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
isAsyncStarted
public boolean isAsyncStarted()
- Specified by:
isAsyncStartedin interfaceServletRequest- Overrides:
isAsyncStartedin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()
- Specified by:
isAsyncSupportedin interfaceServletRequest- Overrides:
isAsyncSupportedin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
startAsync
public AsyncContext startAsync()
- Specified by:
startAsyncin interfaceServletRequest- Overrides:
startAsyncin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
startAsync
public AsyncContext startAsync(ServletRequest request, ServletResponse response)
- Specified by:
startAsyncin interfaceServletRequest- Overrides:
startAsyncin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
getSession
public HttpSession getSession(boolean create)
getSession should never return an invalidated session.- Specified by:
getSessionin interfaceHttpServletRequest- Overrides:
getSessionin classorg.apache.myfaces.test.mock.MockHttpServletRequest
-
setRequestLocales
public void setRequestLocales(List<Locale> requestLocales)
-
setRequestUrl
public void setRequestUrl(String requestUrl)
-
-