|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.test.FakeRequest
public class FakeRequest
Fake HTTP request implementation.
Constructor Summary | |
---|---|
FakeRequest()
Constructs a new GET / fake request. |
|
FakeRequest(java.lang.String method,
java.lang.String path)
Constructs a new request. |
Method Summary | ||
---|---|---|
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. |
|
|
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FakeRequest()
public FakeRequest(java.lang.String method, java.lang.String path)
Method Detail |
---|
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 set
public FakeRequest withJsonBody(com.fasterxml.jackson.databind.JsonNode node)
node
- the Json Node
public FakeRequest withJsonBody(play.api.libs.json.JsValue json)
json
- the JsValue
public 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 Data
public FakeRequest withXmlBody(org.xml.sax.InputSource xml)
xml
- the XML
public FakeRequest withTextBody(java.lang.String text)
text
- the text
public <T> FakeRequest withBody(T body)
body
- the Body
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |