com.jayway.restassured.internal
Class RestAssuredResponseImpl

java.lang.Object
  extended by com.jayway.restassured.internal.RestAssuredResponseImpl
All Implemented Interfaces:
Response, ResponseBody, groovy.lang.GroovyObject

public class RestAssuredResponseImpl
extends Object
implements Response, groovy.lang.GroovyObject


Constructor Summary
RestAssuredResponseImpl()
           
 
Method Summary
 Response andReturn()
          Syntactic sugar, simply returns the same response instance.
 byte[] asByteArray()
          Get the body as a byte array.
 String asString()
          Get the body as a string.
 ResponseBody body()
          Returns the response body
 String contentType()
          Get the content type of the response
 String cookie(String name)
          Get a single cookie value associated with the given name.
 Map<String,String> cookies()
          The response cookies.
 ResponseBody getBody()
          Returns the response body
 Object getContent()
           
 String getContentType()
          Get the content type of the response
 String getCookie(String name)
          Get a single cookie value associated with the given name.
 Map<String,String> getCookies()
          The response cookies.
 String getHeader(String name)
          Get a single header value associated with the given name.
 Map<String,String> getHeaders()
          The response headers.
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String property)
           
 Object getResponseHeaders()
           
 int getStatusCode()
          Get the status code of the response.
 String getStatusLine()
          Get the status line of the response.
 String header(String name)
          Get a single header value associated with the given name.
 Map<String,String> headers()
          The response headers.
 Object invokeMethod(String method, Object arguments)
           
 Object parseContentType(Object httpResponse)
           
 Object parseCookies()
           
 Object parseHeaders(Object httpResponse)
           
 void parseResponse(Object httpResponse, Object content)
           
 Object parseStatus(Object httpResponse)
           
 String print()
          Print the response body and return it as string.
 void setContent(Object value)
           
 void setContentType(Object value)
           
 void setCookies(Object value)
           
 void setMetaClass(groovy.lang.MetaClass mc)
           
 void setProperty(String property, Object value)
           
 void setResponseHeaders(Object value)
           
 void setStatusCode(Object value)
           
 void setStatusLine(Object value)
           
 int statusCode()
          Get the status code of the response.
 String statusLine()
          Get the status line of the response.
 Response thenReturn()
          Syntactic sugar, simply returns the same response instance.
 Object toString(groovy.lang.Writable node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestAssuredResponseImpl

public RestAssuredResponseImpl()
Method Detail

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass mc)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String method,
                           Object arguments)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String property,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject

getResponseHeaders

public Object getResponseHeaders()

setResponseHeaders

public void setResponseHeaders(Object value)

setCookies

public void setCookies(Object value)

getContent

public Object getContent()

setContent

public void setContent(Object value)

setContentType

public void setContentType(Object value)

setStatusLine

public void setStatusLine(Object value)

setStatusCode

public void setStatusCode(Object value)

parseResponse

public void parseResponse(Object httpResponse,
                          Object content)

parseStatus

public Object parseStatus(Object httpResponse)

parseContentType

public Object parseContentType(Object httpResponse)

parseCookies

public Object parseCookies()

parseHeaders

public Object parseHeaders(Object httpResponse)

toString

public Object toString(groovy.lang.Writable node)

print

public String print()
Description copied from interface: ResponseBody
Print the response body and return it as string. Mainly useful for debug purposes when writing tests.

Specified by:
print in interface ResponseBody
Returns:
The body as a string.

asString

public String asString()
Description copied from interface: ResponseBody
Get the body as a string. You can only do this if you've not used REST Assured response expectations.

Specified by:
asString in interface ResponseBody
Returns:
The body as a string.

asByteArray

public byte[] asByteArray()
Description copied from interface: ResponseBody
Get the body as a byte array. You can only do this if you've not used REST Assured response expectations.

Specified by:
asByteArray in interface ResponseBody
Returns:
The body as a array.

andReturn

public Response andReturn()
Description copied from interface: Response
Syntactic sugar, simply returns the same response instance.

Specified by:
andReturn in interface Response
Returns:
The same response instance.

body

public ResponseBody body()
Description copied from interface: Response
Returns the response body

Specified by:
body in interface Response
Returns:
The response body.

thenReturn

public Response thenReturn()
Description copied from interface: Response
Syntactic sugar, simply returns the same response instance.

Specified by:
thenReturn in interface Response
Returns:
The same response instance.

getBody

public ResponseBody getBody()
Description copied from interface: Response
Returns the response body

Specified by:
getBody in interface Response
Returns:
The response body.

headers

public Map<String,String> headers()
Description copied from interface: Response
The response headers.

Specified by:
headers in interface Response
Returns:
The response headers.

getHeaders

public Map<String,String> getHeaders()
Description copied from interface: Response
The response headers.

Specified by:
getHeaders in interface Response
Returns:
The response headers.

header

public String header(String name)
Description copied from interface: Response
Get a single header value associated with the given name.

Specified by:
header in interface Response
Returns:
The header value or null if value was not found.

getHeader

public String getHeader(String name)
Description copied from interface: Response
Get a single header value associated with the given name.

Specified by:
getHeader in interface Response
Returns:
The header value or null if value was not found.

cookies

public Map<String,String> cookies()
Description copied from interface: Response
The response cookies.

Specified by:
cookies in interface Response
Returns:
The response cookies.

getCookies

public Map<String,String> getCookies()
Description copied from interface: Response
The response cookies.

Specified by:
getCookies in interface Response
Returns:
The response cookies.

cookie

public String cookie(String name)
Description copied from interface: Response
Get a single cookie value associated with the given name.

Specified by:
cookie in interface Response
Returns:
The cookie value or null if value was not found.

getCookie

public String getCookie(String name)
Description copied from interface: Response
Get a single cookie value associated with the given name.

Specified by:
getCookie in interface Response
Returns:
The cookie value or null if value was not found.

contentType

public String contentType()
Description copied from interface: Response
Get the content type of the response

Specified by:
contentType in interface Response
Returns:
The content type value or null if not found.

getContentType

public String getContentType()
Description copied from interface: Response
Get the content type of the response

Specified by:
getContentType in interface Response
Returns:
The content type value or null if not found.

statusLine

public String statusLine()
Description copied from interface: Response
Get the status line of the response.

Specified by:
statusLine in interface Response
Returns:
The status line of the response.

statusCode

public int statusCode()
Description copied from interface: Response
Get the status code of the response.

Specified by:
statusCode in interface Response
Returns:
The status code of the response.

getStatusLine

public String getStatusLine()
Description copied from interface: Response
Get the status line of the response.

Specified by:
getStatusLine in interface Response
Returns:
The status line of the response.

getStatusCode

public int getStatusCode()
Description copied from interface: Response
Get the status code of the response.

Specified by:
getStatusCode in interface Response
Returns:
The status code of the response.


Copyright © 2010-2011. All Rights Reserved.