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)
Response
getHeader
in interface Response
name
- The name of the headernull
is returned.public int getStatusCode()
getStatusCode
in interface Response
public void setStatusCode(int statusCode)
public String getResponseBodyAsString()
getResponseBodyAsString
in interface Response
public void setResponseBodyAsString(String responseBodyAsString)
public InputStream getResponseBodyAsStream()
getResponseBodyAsStream
in interface Response
public void setResponseBodyAsStream(InputStream responseBodyAsStream)
public <T> T getEntity(Class<T> entityClass) throws ResponseException
Response
getEntity
in interface Response
entityClass
- the type of the responseResponseException
- if there was difficulty reading the response or unmarshalling the objectpublic String getStatusText()
getStatusText
in interface Response
public void setStatusText(String statusText)
public boolean isSuccessful()
isSuccessful
in interface Response
public void setSuccessful(boolean successful)
public Map<String,String> getHeaders()
Response
getHeaders
in interface Response
Copyright © 2015 Atlassian. All rights reserved.