public class MockWebRequest extends WebRequest
WebRequest
.HEADER_AJAX, HEADER_AJAX_BASE_URL, PARAM_AJAX, PARAM_AJAX_BASE_URL, PARAM_AJAX_REQUEST_ANTI_CACHE
Constructor and Description |
---|
MockWebRequest(Url url)
Construct.
|
MockWebRequest(Url url,
String contextPath,
String filterPath,
String prefixToContextPath)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
addCookie(javax.servlet.http.Cookie cookie) |
void |
addDateHeader(String name,
Time value)
Adds date header for given name.
|
void |
addHeader(String name,
String value)
Adds header for given name.
|
MockWebRequest |
cloneWithUrl(Url url) |
Charset |
getCharset() |
Url |
getClientUrl() |
Object |
getContainerRequest() |
String |
getContextPath() |
List<javax.servlet.http.Cookie> |
getCookies() |
Time |
getDateHeader(String name) |
String |
getFilterPath() |
String |
getHeader(String name) |
List<String> |
getHeaders(String name) |
Locale |
getLocale() |
MockRequestParameters |
getPostParameters() |
String |
getPrefixToContextPath() |
Url |
getUrl() |
void |
removeHeader(String header)
Removes header with specified name.
|
MockWebRequest |
setContextPath(String contextPath) |
void |
setCookies(List<javax.servlet.http.Cookie> cookies)
Sets cookies for current request.
|
void |
setDateHeader(String name,
Time value)
Sets date header for given name.
|
MockWebRequest |
setFilterPath(String filterPath) |
void |
setHeader(String name,
String value)
Sets header for given name.
|
void |
setLocale(Locale locale)
Sets request locale.
|
MockWebRequest |
setPrefixToContextPath(String prefixToContextPath) |
void |
setUrl(Url url) |
String |
toString() |
getCookie, getIfModifiedSinceHeader, isAjax, shouldPreserveClientUrl
getOriginalUrl, getQueryParameters, getRequestParameters
public MockWebRequest(Url url)
url
- public MockWebRequest cloneWithUrl(Url url)
cloneWithUrl
in class WebRequest
public void setUrl(Url url)
url
- public void setCookies(List<javax.servlet.http.Cookie> cookies)
cookies
- public void addCookie(javax.servlet.http.Cookie cookie)
cookie
- public List<javax.servlet.http.Cookie> getCookies()
getCookies
in class WebRequest
public Time getDateHeader(String name)
getDateHeader
in class WebRequest
public void setDateHeader(String name, Time value)
name
- value
- public void addDateHeader(String name, Time value)
name
- value
- public String getHeader(String name)
getHeader
in class WebRequest
public void setHeader(String name, String value)
name
- value
- public void addHeader(String name, String value)
name
- value
- public void setLocale(Locale locale)
locale
- public List<String> getHeaders(String name)
getHeaders
in class WebRequest
public void removeHeader(String header)
header
- public MockRequestParameters getPostParameters()
getPostParameters
in class Request
public Charset getCharset()
getCharset
in class Request
public Url getClientUrl()
getClientUrl
in class Request
public Object getContainerRequest()
getContainerRequest
in class Request
public String getContextPath()
getContextPath
in class Request
public MockWebRequest setContextPath(String contextPath)
contextPath
- public String getFilterPath()
getFilterPath
in class Request
public MockWebRequest setFilterPath(String filterPath)
filterPath
- public String getPrefixToContextPath()
getPrefixToContextPath
in class Request
public MockWebRequest setPrefixToContextPath(String prefixToContextPath)
prefixToContextPath
- Copyright © 2006–2016 Apache Software Foundation. All rights reserved.