uk.co.mruoc.http.client

## Class FakeApacheHttpClient

- java.lang.Object
- - uk.co.mruoc.http.client.FakeApacheHttpClient

All Implemented Interfaces:
  org.apache.http.client.HttpClient

    public class FakeApacheHttpClient
    extends java.lang.Object
    implements org.apache.http.client.HttpClient

### Constructor Summary

Constructors
Constructor and Description
`FakeApacheHttpClient()`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.List<Request>` `allRequests()`
`void` `cannedResponse(int status)`
`void` `cannedResponse(int status, java.lang.String body)`
`void` `cannedResponse(int status, java.lang.String body, Headers headers)`
`org.apache.http.HttpResponse` `execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request)`
`org.apache.http.HttpResponse` `execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)`
`<T> T` `execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler)`
`<T> T` `execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler, org.apache.http.protocol.HttpContext context)`
`org.apache.http.HttpResponse` `execute(org.apache.http.client.methods.HttpUriRequest rawRequest)`
`org.apache.http.HttpResponse` `execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.protocol.HttpContext context)`
`<T> T` `execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler)`
`<T> T` `execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler, org.apache.http.protocol.HttpContext context)`
`org.apache.http.conn.ClientConnectionManager` `getConnectionManager()`
`org.apache.http.params.HttpParams` `getParams()`
`java.lang.String` `lastRequestBody()`
`java.lang.String` `lastRequestHeader(java.lang.String name)`
`Method` `lastRequestMethod()`
`java.lang.String` `lastRequestUri()`
`void` `throwsIoException()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FakeApacheHttpClient

    public FakeApacheHttpClient()

### Method Detail

#### execute

    public org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest rawRequest)
                                         throws java.io.IOException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`

#### cannedResponse

    public void cannedResponse(int status)

#### cannedResponse

    public void cannedResponse(int status,
                               java.lang.String body)

#### cannedResponse

    public void cannedResponse(int status,
                               java.lang.String body,
                               Headers headers)

#### allRequests

    public java.util.List<Request> allRequests()

#### lastRequestUri

    public java.lang.String lastRequestUri()

#### lastRequestBody

    public java.lang.String lastRequestBody()

#### lastRequestMethod

    public Method lastRequestMethod()

#### lastRequestHeader

    public java.lang.String lastRequestHeader(java.lang.String name)

#### throwsIoException

    public void throwsIoException()

#### execute

    public org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest request,
                                                org.apache.http.protocol.HttpContext context)
                                         throws java.io.IOException,
                                                org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public org.apache.http.HttpResponse execute(org.apache.http.HttpHost target,
                                                org.apache.http.HttpRequest request)
                                         throws java.io.IOException,
                                                org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public org.apache.http.HttpResponse execute(org.apache.http.HttpHost target,
                                                org.apache.http.HttpRequest request,
                                                org.apache.http.protocol.HttpContext context)
                                         throws java.io.IOException,
                                                org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public <T> T execute(org.apache.http.client.methods.HttpUriRequest request,
                         org.apache.http.client.ResponseHandler<? extends T> responseHandler)
                  throws java.io.IOException,
                         org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public <T> T execute(org.apache.http.client.methods.HttpUriRequest request,
                         org.apache.http.client.ResponseHandler<? extends T> responseHandler,
                         org.apache.http.protocol.HttpContext context)
                  throws java.io.IOException,
                         org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public <T> T execute(org.apache.http.HttpHost target,
                         org.apache.http.HttpRequest request,
                         org.apache.http.client.ResponseHandler<? extends T> responseHandler)
                  throws java.io.IOException,
                         org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### execute

    public <T> T execute(org.apache.http.HttpHost target,
                         org.apache.http.HttpRequest request,
                         org.apache.http.client.ResponseHandler<? extends T> responseHandler,
                         org.apache.http.protocol.HttpContext context)
                  throws java.io.IOException,
                         org.apache.http.client.ClientProtocolException

Specified by:
  `execute` in interface `org.apache.http.client.HttpClient`
Throws:
  `java.io.IOException`
  `org.apache.http.client.ClientProtocolException`

#### getParams

    public org.apache.http.params.HttpParams getParams()

Specified by:
  `getParams` in interface `org.apache.http.client.HttpClient`

#### getConnectionManager

    public org.apache.http.conn.ClientConnectionManager getConnectionManager()

Specified by:
  `getConnectionManager` in interface `org.apache.http.client.HttpClient`