public class MockfriendlyResponse extends Object implements org.apache.http.client.methods.CloseableHttpResponse
| Modifier and Type | Class and Description |
|---|---|
static class |
MockfriendlyResponse.MockedResponseBuilder |
| Modifier and Type | Field and Description |
|---|---|
static RuntimeException |
CONNECTION_REFUSED |
static org.apache.http.client.methods.CloseableHttpResponse |
DEFAULT_RESPONSE |
static Map<String,RuntimeException> |
errors |
static Map<String,org.apache.http.client.methods.CloseableHttpResponse> |
responses |
| Constructor and Description |
|---|
MockfriendlyResponse() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(org.apache.http.Header header) |
void |
addHeader(String name,
String value) |
void |
close() |
boolean |
containsHeader(String name) |
org.apache.http.Header[] |
getAllHeaders() |
static org.apache.http.client.methods.CloseableHttpResponse |
getDefaultResponse() |
org.apache.http.HttpEntity |
getEntity() |
org.apache.http.Header |
getFirstHeader(String name) |
org.apache.http.Header[] |
getHeaders(String name) |
org.apache.http.Header |
getLastHeader(String name) |
Locale |
getLocale() |
org.apache.http.params.HttpParams |
getParams() |
org.apache.http.ProtocolVersion |
getProtocolVersion() |
org.apache.http.StatusLine |
getStatusLine() |
org.apache.http.HeaderIterator |
headerIterator() |
org.apache.http.HeaderIterator |
headerIterator(String name) |
void |
removeHeader(org.apache.http.Header header) |
void |
removeHeaders(String name) |
void |
setEntity(org.apache.http.HttpEntity entity) |
void |
setHeader(org.apache.http.Header header) |
void |
setHeader(String name,
String value) |
void |
setHeaders(org.apache.http.Header[] headers) |
void |
setLocale(Locale loc) |
void |
setParams(org.apache.http.params.HttpParams params) |
void |
setReasonPhrase(String reason) |
void |
setStatusCode(int code) |
void |
setStatusLine(org.apache.http.ProtocolVersion ver,
int code) |
void |
setStatusLine(org.apache.http.ProtocolVersion ver,
int code,
String reason) |
void |
setStatusLine(org.apache.http.StatusLine statusline) |
public static final Map<String,org.apache.http.client.methods.CloseableHttpResponse> responses
public static final Map<String,RuntimeException> errors
public static org.apache.http.client.methods.CloseableHttpResponse DEFAULT_RESPONSE
public static RuntimeException CONNECTION_REFUSED
public static org.apache.http.client.methods.CloseableHttpResponse getDefaultResponse()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic org.apache.http.StatusLine getStatusLine()
getStatusLine in interface org.apache.http.HttpResponsepublic void setStatusLine(org.apache.http.StatusLine statusline)
setStatusLine in interface org.apache.http.HttpResponsepublic void setStatusLine(org.apache.http.ProtocolVersion ver,
int code)
setStatusLine in interface org.apache.http.HttpResponsepublic void setStatusLine(org.apache.http.ProtocolVersion ver,
int code,
String reason)
setStatusLine in interface org.apache.http.HttpResponsepublic void setStatusCode(int code)
throws IllegalStateException
setStatusCode in interface org.apache.http.HttpResponseIllegalStateExceptionpublic void setReasonPhrase(String reason) throws IllegalStateException
setReasonPhrase in interface org.apache.http.HttpResponseIllegalStateExceptionpublic org.apache.http.HttpEntity getEntity()
getEntity in interface org.apache.http.HttpResponsepublic void setEntity(org.apache.http.HttpEntity entity)
setEntity in interface org.apache.http.HttpResponsepublic Locale getLocale()
getLocale in interface org.apache.http.HttpResponsepublic void setLocale(Locale loc)
setLocale in interface org.apache.http.HttpResponsepublic org.apache.http.ProtocolVersion getProtocolVersion()
getProtocolVersion in interface org.apache.http.HttpMessagepublic boolean containsHeader(String name)
containsHeader in interface org.apache.http.HttpMessagepublic org.apache.http.Header[] getHeaders(String name)
getHeaders in interface org.apache.http.HttpMessagepublic org.apache.http.Header getFirstHeader(String name)
getFirstHeader in interface org.apache.http.HttpMessagepublic org.apache.http.Header getLastHeader(String name)
getLastHeader in interface org.apache.http.HttpMessagepublic org.apache.http.Header[] getAllHeaders()
getAllHeaders in interface org.apache.http.HttpMessagepublic void addHeader(org.apache.http.Header header)
addHeader in interface org.apache.http.HttpMessagepublic void addHeader(String name, String value)
addHeader in interface org.apache.http.HttpMessagepublic void setHeader(org.apache.http.Header header)
setHeader in interface org.apache.http.HttpMessagepublic void setHeader(String name, String value)
setHeader in interface org.apache.http.HttpMessagepublic void setHeaders(org.apache.http.Header[] headers)
setHeaders in interface org.apache.http.HttpMessagepublic void removeHeader(org.apache.http.Header header)
removeHeader in interface org.apache.http.HttpMessagepublic void removeHeaders(String name)
removeHeaders in interface org.apache.http.HttpMessagepublic org.apache.http.HeaderIterator headerIterator()
headerIterator in interface org.apache.http.HttpMessagepublic org.apache.http.HeaderIterator headerIterator(String name)
headerIterator in interface org.apache.http.HttpMessagepublic org.apache.http.params.HttpParams getParams()
getParams in interface org.apache.http.HttpMessagepublic void setParams(org.apache.http.params.HttpParams params)
setParams in interface org.apache.http.HttpMessageCopyright © 2019 Digipost. All rights reserved.