public class MockHttpClient extends CloseableHttpClient
Modifier and Type | Field and Description |
---|---|
org.apache.http.HttpRequest |
httpRequest
Last httpRequest - you can check this in tests
|
cz.tdp.kshield.example.MockHttpClient.MockHttpResponse |
httpResponse
Last httpResponse - you can check this in tests
|
Constructor and Description |
---|
MockHttpClient(String response) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected CloseableHttpResponse |
doExecute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context) |
ClientConnectionManager |
getConnectionManager() |
org.apache.http.params.HttpParams |
getParams() |
void |
setResponse(String response)
Sets new fake response as string
|
void |
setStatus(int status) |
public org.apache.http.HttpRequest httpRequest
public cz.tdp.kshield.example.MockHttpClient.MockHttpResponse httpResponse
public MockHttpClient(String response)
response
- fake response as Stringpublic void close() throws IOException
IOException
protected CloseableHttpResponse doExecute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws IOException, ClientProtocolException
doExecute
in class CloseableHttpClient
IOException
ClientProtocolException
public ClientConnectionManager getConnectionManager()
public org.apache.http.params.HttpParams getParams()
public final void setResponse(String response)
response
- public final void setStatus(int status)
Copyright © 2013 TDP Ltd. All Rights Reserved.