| Constructor and Description |
|---|
MockResponse() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getEntity(Class<T> entityClass)
Unmarshall the response body as the specified type
|
String |
getHeader(String name)
Get's the header by the given name
|
Map<String,String> |
getHeaders()
Get a map of all the headers
|
InputStream |
getResponseBodyAsStream() |
String |
getResponseBodyAsString() |
int |
getStatusCode() |
String |
getStatusText() |
boolean |
isSuccessful() |
void |
setHeaders(Map<String,String> headers) |
void |
setResponseBodyAsStream(InputStream responseBodyAsStream) |
void |
setResponseBodyAsString(String responseBodyAsString) |
void |
setStatusCode(int statusCode) |
void |
setStatusText(String statusText) |
void |
setSuccessful(boolean successful) |
public String getHeader(String name)
ResponsegetHeader in interface Responsename - The name of the headernull is returned.public int getStatusCode()
getStatusCode in interface Responsepublic void setStatusCode(int statusCode)
public String getResponseBodyAsString()
getResponseBodyAsString in interface Responsepublic void setResponseBodyAsString(String responseBodyAsString)
public InputStream getResponseBodyAsStream()
getResponseBodyAsStream in interface Responsepublic void setResponseBodyAsStream(InputStream responseBodyAsStream)
public <T> T getEntity(Class<T> entityClass) throws ResponseException
ResponsegetEntity in interface ResponseentityClass - the type of the responseResponseException - if there was difficulty reading the response or unmarshalling the objectpublic String getStatusText()
getStatusText in interface Responsepublic void setStatusText(String statusText)
public boolean isSuccessful()
isSuccessful in interface Responsepublic void setSuccessful(boolean successful)
public Map<String,String> getHeaders()
ResponsegetHeaders in interface ResponseCopyright © 2018 Atlassian. All rights reserved.