HttpRequest request = new BasicHttpRequest("GET", "/stuff");
this.target = new HttpHost("localhost.local");
HttpRoute route = new HttpRoute(this.target, null, false);
HttpRoutedConnection conn = Mockito.mock(HttpRoutedConnection.class);
Mockito.when(conn.getRoute()).thenReturn(route);
Mockito.when(conn.isSecure()).thenReturn(Boolean.FALSE);
Mockito.when(conn.getRemoteAddress()).thenReturn(InetAddress.getByName("localhost"));
Mockito.when(conn.getRemotePort()).thenReturn(1234);
HttpContext context = new BasicHttpContext();
context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);