Class MockHttpRequest
java.lang.Object
org.jboss.resteasy.plugins.server.BaseHttpRequest
org.jboss.resteasy.mock.MockHttpRequest
-
Field Summary
Modifier and TypeFieldDescriptionprotected ResteasyAsynchronousContext
protected static final URI
protected ResteasyHttpHeaders
protected String
protected InputStream
Fields inherited from class org.jboss.resteasy.plugins.server.BaseHttpRequest
decodedFormParameters, formParameters, uri
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(jakarta.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
(jakarta.ws.rs.core.MediaType type) contentType
(String type) static MockHttpRequest
static MockHttpRequest
static MockHttpRequest
static MockHttpRequest
deepCopy
(HttpRequest request) static MockHttpRequest
void
static MockHttpRequest
getAttribute
(String attribute) Map of contextual data.jakarta.ws.rs.core.HttpHeaders
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.Returns the fully qualified name of the client or the last proxy that sent the request.getUri()
This method *MUST* always return the same instance.static MockHttpRequest
void
protected static MockHttpRequest
initWithUri
(String uri) static MockHttpRequest
static MockHttpRequest
static MockHttpRequest
static MockHttpRequest
void
removeAttribute
(String name) void
setAsynchronousContext
(ResteasyAsynchronousContext asynchronousContext) void
setAttribute
(String name, Object value) void
setHttpMethod
(String method) void
setInputStream
(InputStream stream) If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().boolean
Methods inherited from class org.jboss.resteasy.plugins.server.BaseHttpRequest
formParametersRead, getDecodedFormParameters, getFormParameters, isInitial, setRequestUri, setRequestUri
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.resteasy.spi.HttpRequest
getFormEntityPart, getFormEntityParts
-
Field Details
-
httpHeaders
-
inputStream
-
httpMethod
-
attributes
-
asynchronousContext
-
EMPTY_URI
-
-
Constructor Details
-
MockHttpRequest
protected MockHttpRequest()
-
-
Method Details
-
initWithUri
- Throws:
URISyntaxException
-
create
public static MockHttpRequest create(String httpMethod, String absolute, String query, String contextPath) -
create
- Throws:
URISyntaxException
-
create
-
options
- Throws:
URISyntaxException
-
get
- Throws:
URISyntaxException
-
post
- Throws:
URISyntaxException
-
put
- Throws:
URISyntaxException
-
patch
- 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
- form param namevalue
- form param value- Returns:
MockHttpRequest
-
getHttpHeaders
public jakarta.ws.rs.core.HttpHeaders getHttpHeaders() -
getMutableHeaders
-
getInputStream
-
setInputStream
Description copied from interface:HttpRequest
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). It will only override it for the resteasy HttpRequest- Parameters:
stream
- input stream
-
getUri
Description copied from interface:HttpRequest
This method *MUST* always return the same instance.- Specified by:
getUri
in interfaceHttpRequest
- Overrides:
getUri
in classBaseHttpRequest
- Returns:
- uri info
-
getHttpMethod
-
initialRequestThreadFinished
public void initialRequestThreadFinished() -
getAttribute
Description copied from interface:HttpRequest
Map of contextual data. Similar to HttpServletRequest attributes- Parameters:
attribute
- attribute name- Returns:
- attribute
-
setAttribute
-
removeAttribute
-
getAttributeNames
-
getAsyncContext
-
forward
-
wasForwarded
public boolean wasForwarded() -
getRemoteHost
Description copied from interface:HttpRequest
Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.- Returns:
- a
String
containing the fully qualified name of the client
-
getRemoteAddress
Description copied from interface:HttpRequest
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Returns:
- a
String
containing the IP address of the client that sent the request
-