abstract class AbstractGrailsMockHttpServletResponse extends MockHttpServletResponse
Simple sub-class of Spring's MockHttpServletResponse that adds the left-shift operator, "<<".
| Fields inherited from class | Fields |
|---|---|
class MockHttpServletResponse |
SC_CONTINUE, SC_SWITCHING_PROTOCOLS, SC_OK, SC_CREATED, SC_ACCEPTED, SC_NON_AUTHORITATIVE_INFORMATION, SC_NO_CONTENT, SC_RESET_CONTENT, SC_PARTIAL_CONTENT, SC_MULTIPLE_CHOICES, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_FOUND, SC_SEE_OTHER, SC_NOT_MODIFIED, SC_USE_PROXY, SC_TEMPORARY_REDIRECT, SC_PERMANENT_REDIRECT, SC_BAD_REQUEST, SC_UNAUTHORIZED, SC_PAYMENT_REQUIRED, SC_FORBIDDEN, SC_NOT_FOUND, SC_METHOD_NOT_ALLOWED, SC_NOT_ACCEPTABLE, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_TIMEOUT, SC_CONFLICT, SC_GONE, SC_LENGTH_REQUIRED, SC_PRECONDITION_FAILED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_URI_TOO_LONG, SC_UNSUPPORTED_MEDIA_TYPE, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_EXPECTATION_FAILED, SC_MISDIRECTED_REQUEST, SC_UNPROCESSABLE_CONTENT, SC_UPGRADE_REQUIRED, SC_INTERNAL_SERVER_ERROR, SC_NOT_IMPLEMENTED, SC_BAD_GATEWAY, SC_SERVICE_UNAVAILABLE, SC_GATEWAY_TIMEOUT, SC_HTTP_VERSION_NOT_SUPPORTED |
| Constructor and description |
|---|
AbstractGrailsMockHttpServletResponse() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
JSONElement |
getJson()Get the response JSON |
|
java.lang.String |
getRedirectUrl() |
|
java.lang.String |
getRedirectedUrl() |
|
java.lang.String |
getText()The response body as text |
|
GPathResult |
getXml()Get the response XML |
|
java.lang.String |
header(java.lang.String name)Return the primary value for the given header as a String, if any. |
|
java.util.List<java.lang.String> |
headers(java.lang.String name)Return all values for the given header as a List of Strings. |
|
void |
leftShift(java.lang.String content)Appends the given content string to the response's output stream. |
|
void |
reset() |
|
void |
setFormat(java.lang.String format)Sets the response format |
Get the response JSON
The response body as text
Get the response XML
Return the primary value for the given header as a String, if any. Will return the first value in case of multiple values.
name - the name of the headernull if noneReturn all values for the given header as a List of Strings.
name - the name of the headerAppends the given content string to the response's output stream.
Sets the response format
format - The format of the response