Class MockHttpRequest
java.lang.Object
org.jboss.resteasy.plugins.server.BaseHttpRequest
org.jboss.resteasy.mock.MockHttpRequest
- All Implemented Interfaces:
HttpRequest
- Version:
- $Revision: 1 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ResteasyAsynchronousContextprotected static final URIprotected ResteasyHttpHeadersprotected Stringprotected InputStreamFields inherited from class BaseHttpRequest
decodedFormParameters, formParameters, uri -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(javax.ws.rs.core.MediaType accept) addFormHeader(String name, String value) Set CONTENT-TYPE to ""application/x-www-form-urlencoded"content(byte[] bytes) content(InputStream stream) contentType(String type) contentType(javax.ws.rs.core.MediaType type) static MockHttpRequeststatic MockHttpRequeststatic MockHttpRequestdeepCopy(HttpRequest request) static MockHttpRequestvoidstatic MockHttpRequestgetAttribute(String attribute) Map of contextual data.javax.ws.rs.core.HttpHeadersgetUri()This method *MUST* always return the same instance.static MockHttpRequestvoidprotected static MockHttpRequestinitWithUri(String uri) private static MockHttpRequestinitWithUri(URI absoluteUri, URI baseUri) static MockHttpRequeststatic MockHttpRequeststatic MockHttpRequestvoidremoveAttribute(String name) voidsetAsynchronousContext(ResteasyAsynchronousContext asynchronousContext) voidsetAttribute(String name, Object value) voidsetHttpMethod(String method) voidsetInputStream(InputStream stream) If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().booleanMethods inherited from class BaseHttpRequest
getDecodedFormParameters, getFormParameters, isInitial, setRequestUri, setRequestUri
-
Field Details
-
httpHeaders
-
inputStream
-
httpMethod
-
attributes
-
asynchronousContext
-
EMPTY_URI
-
-
Constructor Details
-
MockHttpRequest
protected MockHttpRequest()
-
-
Method Details
-
initWithUri
- Throws:
URISyntaxException
-
initWithUri
-
create
- Throws:
URISyntaxException
-
create
-
options
- Throws:
URISyntaxException
-
get
- Throws:
URISyntaxException
-
post
- Throws:
URISyntaxException
-
put
- Throws:
URISyntaxException
-
delete
- Throws:
URISyntaxException
-
head
- Throws:
URISyntaxException
-
deepCopy
- Throws:
IOException
-
setHttpMethod
-
getAsynchronousContext
-
setAsynchronousContext
-
header
-
accept
-
accept
-
accept
-
language
-
cookie
-
contentType
-
contentType
-
content
-
content
-
addFormHeader
Set CONTENT-TYPE to ""application/x-www-form-urlencoded"- Parameters:
name-value-- Returns:
-
getHttpHeaders
public javax.ws.rs.core.HttpHeaders getHttpHeaders() -
getMutableHeaders
-
getInputStream
-
setInputStream
Description copied from interface:HttpRequestIf you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). It will only override it for the resteasy HttpRequest- Parameters:
stream-
-
getUri
Description copied from interface:HttpRequestThis method *MUST* always return the same instance.- Specified by:
getUriin interfaceHttpRequest- Overrides:
getUriin classBaseHttpRequest
-
getHttpMethod
-
initialRequestThreadFinished
public void initialRequestThreadFinished() -
getAttribute
Description copied from interface:HttpRequestMap of contextual data. Similar to HttpServletRequest attributes- Returns:
-
setAttribute
-
removeAttribute
-
getAttributeNames
-
getAsyncContext
-
forward
-
wasForwarded
public boolean wasForwarded()
-