|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.sal.testresources.net.MockResponse
public class MockResponse
Mock response that provides setters for all properties
| Constructor Summary | |
|---|---|
MockResponse()
|
|
| Method Summary | ||
|---|---|---|
|
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)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockResponse()
| Method Detail |
|---|
public String getHeader(String name)
Response
getHeader in interface Responsename - The name of the header
null 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
Response
getEntity in interface ResponseentityClass - the type of the response
ResponseException - 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()
Response
getHeaders in interface Responsepublic void setHeaders(Map<String,String> headers)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||