public class FakeRequest
extends java.lang.Object
Constructor and Description |
---|
FakeRequest()
Constructs a new GET / fake request.
|
FakeRequest(java.lang.String method,
java.lang.String path)
Constructs a new request.
|
Modifier and Type | Method and Description |
---|---|
play.api.mvc.Request<Http.RequestBody> |
getWrappedRequest() |
FakeRequest |
withAnyContent(play.api.mvc.AnyContent content,
java.lang.String contentType,
java.lang.String method)
Set a AnyContent to this request.
|
<T> FakeRequest |
withBody(T body)
Set a any body to this request.
|
FakeRequest |
withCookies(Http.Cookie... cookies)
Add cookies to this request
|
FakeRequest |
withFlash(java.lang.String name,
java.lang.String value)
Add addtional session to this request.
|
FakeRequest |
withFormUrlEncodedBody(java.util.Map<java.lang.String,java.lang.String> data)
Set a Form url encoded body to this request.
|
FakeRequest |
withHeader(java.lang.String name,
java.lang.String value)
Add additional headers to this request.
|
FakeRequest |
withJsonBody(com.fasterxml.jackson.databind.JsonNode node)
Set a Json Body to this request.
|
FakeRequest |
withJsonBody(com.fasterxml.jackson.databind.JsonNode node,
java.lang.String method)
Set a Json Body to this request.
|
FakeRequest |
withJsonBody(play.api.libs.json.JsValue json)
Set a Json Body to this request.
|
FakeRequest |
withJsonBody(play.api.libs.json.JsValue json,
java.lang.String method)
Set a Json Body to this request.
|
FakeRequest |
withRawBody(byte[] data)
Set a Binary Data to this request.
|
FakeRequest |
withRemoteAddress(java.lang.String remoteAddress)
Change the remote-address for this request.
|
FakeRequest |
withSession(java.lang.String name,
java.lang.String value)
Add addtional session to this request.
|
FakeRequest |
withTextBody(java.lang.String text)
Set a Text to this request.
|
FakeRequest |
withXmlBody(org.xml.sax.InputSource xml)
Set a XML to this request.
|
public FakeRequest()
public FakeRequest(java.lang.String method, java.lang.String path)
public FakeRequest withRemoteAddress(java.lang.String remoteAddress)
remoteAddress
- the remote address, e.g. "127.0.0.1"public FakeRequest withHeader(java.lang.String name, java.lang.String value)
public FakeRequest withAnyContent(play.api.mvc.AnyContent content, java.lang.String contentType, java.lang.String method)
content
- the AnyContentcontentType
- Content-Type header valuemethod
- The method to be setpublic FakeRequest withJsonBody(com.fasterxml.jackson.databind.JsonNode node)
node
- the Json Nodepublic FakeRequest withJsonBody(play.api.libs.json.JsValue json)
json
- the JsValuepublic FakeRequest withJsonBody(com.fasterxml.jackson.databind.JsonNode node, java.lang.String method)
node
- the Json Nodemethod
- the HTTP method. POST if set to null
public FakeRequest withJsonBody(play.api.libs.json.JsValue json, java.lang.String method)
json
- the JsValuemethod
- the HTTP method. POST if set to null
public FakeRequest withFlash(java.lang.String name, java.lang.String value)
public FakeRequest withSession(java.lang.String name, java.lang.String value)
public FakeRequest withCookies(Http.Cookie... cookies)
public FakeRequest withFormUrlEncodedBody(java.util.Map<java.lang.String,java.lang.String> data)
public play.api.mvc.Request<Http.RequestBody> getWrappedRequest()
public FakeRequest withRawBody(byte[] data)
data
- the Binary Datapublic FakeRequest withXmlBody(org.xml.sax.InputSource xml)
xml
- the XMLpublic FakeRequest withTextBody(java.lang.String text)
text
- the textpublic <T> FakeRequest withBody(T body)
body
- the Body