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 Closeable
close
in interface AutoCloseable
IOException
public org.apache.http.StatusLine getStatusLine()
getStatusLine
in interface org.apache.http.HttpResponse
public void setStatusLine(org.apache.http.StatusLine statusline)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusLine(org.apache.http.ProtocolVersion ver, int code)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusLine(org.apache.http.ProtocolVersion ver, int code, String reason)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusCode(int code) throws IllegalStateException
setStatusCode
in interface org.apache.http.HttpResponse
IllegalStateException
public void setReasonPhrase(String reason) throws IllegalStateException
setReasonPhrase
in interface org.apache.http.HttpResponse
IllegalStateException
public org.apache.http.HttpEntity getEntity()
getEntity
in interface org.apache.http.HttpResponse
public void setEntity(org.apache.http.HttpEntity entity)
setEntity
in interface org.apache.http.HttpResponse
public Locale getLocale()
getLocale
in interface org.apache.http.HttpResponse
public void setLocale(Locale loc)
setLocale
in interface org.apache.http.HttpResponse
public org.apache.http.ProtocolVersion getProtocolVersion()
getProtocolVersion
in interface org.apache.http.HttpMessage
public boolean containsHeader(String name)
containsHeader
in interface org.apache.http.HttpMessage
public org.apache.http.Header[] getHeaders(String name)
getHeaders
in interface org.apache.http.HttpMessage
public org.apache.http.Header getFirstHeader(String name)
getFirstHeader
in interface org.apache.http.HttpMessage
public org.apache.http.Header getLastHeader(String name)
getLastHeader
in interface org.apache.http.HttpMessage
public org.apache.http.Header[] getAllHeaders()
getAllHeaders
in interface org.apache.http.HttpMessage
public void addHeader(org.apache.http.Header header)
addHeader
in interface org.apache.http.HttpMessage
public void addHeader(String name, String value)
addHeader
in interface org.apache.http.HttpMessage
public void setHeader(org.apache.http.Header header)
setHeader
in interface org.apache.http.HttpMessage
public void setHeader(String name, String value)
setHeader
in interface org.apache.http.HttpMessage
public void setHeaders(org.apache.http.Header[] headers)
setHeaders
in interface org.apache.http.HttpMessage
public void removeHeader(org.apache.http.Header header)
removeHeader
in interface org.apache.http.HttpMessage
public void removeHeaders(String name)
removeHeaders
in interface org.apache.http.HttpMessage
public org.apache.http.HeaderIterator headerIterator()
headerIterator
in interface org.apache.http.HttpMessage
public org.apache.http.HeaderIterator headerIterator(String name)
headerIterator
in interface org.apache.http.HttpMessage
public org.apache.http.params.HttpParams getParams()
getParams
in interface org.apache.http.HttpMessage
public void setParams(org.apache.http.params.HttpParams params)
setParams
in interface org.apache.http.HttpMessage
Copyright © 2017 Digipost. All rights reserved.