Package com.vaadin.testbench.unit.mocks
Class MockRequest
-
- All Implemented Interfaces:
-
jakarta.servlet.ServletRequest,jakarta.servlet.http.HttpServletRequest
public class MockRequest implements HttpServletRequest
-
-
Field Summary
Fields Modifier and Type Field Description private StringcharacterEncodingIntprivate final Map<String, Array<String>>parametersprivate List<Part>partsIntprivate Function2<Principal, String, Boolean>isUserInRoleprivate Array<Cookie>cookiesIntprivate LocalelocaleIntprivate PrincipaluserPrincipalIntprivate final ConcurrentHashMap<String, List<String>>headers
-
Constructor Summary
Constructors Constructor Description MockRequest(HttpSession session)
-
Method Summary
-
-
Method Detail
-
getCharacterEncodingInt
final String getCharacterEncodingInt()
-
setCharacterEncodingInt
final Unit setCharacterEncodingInt(String characterEncodingInt)
-
getParameters
final Map<String, Array<String>> getParameters()
-
getPartsInt
final List<Part> getPartsInt()
-
setPartsInt
final Unit setPartsInt(List<Part> partsInt)
-
isUserInRole
final Function2<Principal, String, Boolean> isUserInRole()
-
setUserInRole
final Unit setUserInRole(Function2<Principal, String, Boolean> isUserInRole)
-
getCookiesInt
final Array<Cookie> getCookiesInt()
-
setCookiesInt
final Unit setCookiesInt(Array<Cookie> cookiesInt)
-
getLocaleInt
final Locale getLocaleInt()
-
setLocaleInt
final Unit setLocaleInt(Locale localeInt)
-
getUserPrincipalInt
final Principal getUserPrincipalInt()
-
setUserPrincipalInt
final Unit setUserPrincipalInt(Principal userPrincipalInt)
-
getHeaders
final ConcurrentHashMap<String, List<String>> getHeaders()
-
getInputStream
ServletInputStream getInputStream()
-
startAsync
AsyncContext startAsync()
-
startAsync
AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
-
getProtocol
String getProtocol()
-
getRequestURL
StringBuffer getRequestURL()
-
setCharacterEncoding
Unit setCharacterEncoding(String env)
-
getParameterValues
Array<String> getParameterValues(String name)
-
isAsyncStarted
Boolean isAsyncStarted()
-
getContentLengthLong
Long getContentLengthLong()
-
getRealPath
String getRealPath(String path)
-
isRequestedSessionIdValid
Boolean isRequestedSessionIdValid()
-
getServerPort
Integer getServerPort()
Returns MockHttpEnvironment.serverPort.
-
getRequestedSessionId
String getRequestedSessionId()
-
getServletPath
String getServletPath()
-
getSession
HttpSession getSession(Boolean create)
-
getSession
HttpSession getSession()
-
getServerName
String getServerName()
-
getLocalAddr
String getLocalAddr()
-
isRequestedSessionIdFromCookie
Boolean isRequestedSessionIdFromCookie()
-
isRequestedSessionIdFromURL
Boolean isRequestedSessionIdFromURL()
-
getLocalPort
Integer getLocalPort()
Returns MockHttpEnvironment.localPort.
-
isRequestedSessionIdFromUrl
Boolean isRequestedSessionIdFromUrl()
-
getServletContext
ServletContext getServletContext()
-
getQueryString
String getQueryString()
-
getDispatcherType
DispatcherType getDispatcherType()
-
getParts
Collection<Part> getParts()
-
getLocalName
String getLocalName()
-
isAsyncSupported
Boolean isAsyncSupported()
-
getParameterNames
Enumeration<String> getParameterNames()
-
authenticate
Boolean authenticate(HttpServletResponse response)
-
getPathTranslated
String getPathTranslated()
-
getIntHeader
Integer getIntHeader(String name)
-
changeSessionId
String changeSessionId()
-
getAsyncContext
AsyncContext getAsyncContext()
-
getRequestURI
String getRequestURI()
-
getRequestDispatcher
RequestDispatcher getRequestDispatcher(String path)
-
isUserInRole
Boolean isUserInRole(String role)
Set isUserInRole to modify the outcome of this function.
-
getPathInfo
String getPathInfo()
-
getRemoteUser
String getRemoteUser()
-
getCookies
Array<Cookie> getCookies()
-
getParameterMap
Map<String, Array<String>> getParameterMap()
-
getAttributeNames
Enumeration<String> getAttributeNames()
-
getRemoteAddr
String getRemoteAddr()
-
getHeaders
Enumeration<String> getHeaders(String name)
-
getUserPrincipal
Principal getUserPrincipal()
Set via userPrincipalInt.
-
getReader
BufferedReader getReader()
-
getLocales
Enumeration<Locale> getLocales()
-
getAuthType
String getAuthType()
Returns MockHttpEnvironment.authType
-
getCharacterEncoding
String getCharacterEncoding()
-
removeAttribute
Unit removeAttribute(String name)
-
getContentLength
Integer getContentLength()
-
getContextPath
String getContextPath()
-
getContentType
String getContentType()
-
getHeaderNames
Enumeration<String> getHeaderNames()
-
getAttribute
Object getAttribute(String name)
-
setAttribute
Unit setAttribute(String name, Object value)
-
getParameter
String getParameter(String parameter)
-
getRemotePort
Integer getRemotePort()
Returns MockHttpEnvironment.remotePort.
-
getDateHeader
Long getDateHeader(String name)
-
getRemoteHost
String getRemoteHost()
-
isSecure
Boolean isSecure()
Returns MockHttpEnvironment.isSecure
-
setParameter
final Unit setParameter(String name, String values)
-
-
-
-