Examples of returnResponse()


Examples of org.apache.http.client.fluent.Response.returnResponse()

        Response response = mock(Response.class);
        HttpResponse httpResponse = mock(HttpResponse.class);
        StatusLine statusLine = mock(StatusLine.class);
        when(statusLine.getStatusCode()).thenReturn(404);
        when(httpResponse.getStatusLine()).thenReturn(statusLine);
        when(response.returnResponse()).thenReturn(httpResponse);
        when(executor.execute(any(Request.class))).thenReturn(response);
        when(authProvider.authenticate(any(Executor.class), any(TransportAuthenticationContext.class))).thenReturn(executor);
        ReplicationEndpoint endpoint = new ReplicationEndpoint("http://127.0.0.1:8080/some/resource");
        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
        int maxNoOfPackages = 1;
View Full Code Here

Examples of org.apache.http.client.fluent.Response.returnResponse()

        when(httpResponse.getStatusLine()).thenReturn(statusLine);
        HttpEntity entity = mock(HttpEntity.class);
        InputStream stream = new ByteArrayInputStream("package binary stuff".getBytes("UTF-8"));
        when(entity.getContent()).thenReturn(stream);
        when(httpResponse.getEntity()).thenReturn(entity);
        when(response.returnResponse()).thenReturn(httpResponse);
        when(executor.execute(any(Request.class))).thenReturn(response);
        when(authProvider.authenticate(any(Executor.class), any(TransportAuthenticationContext.class))).thenReturn(executor);
        ReplicationEndpoint endpoint = new ReplicationEndpoint("http://127.0.0.1:8080/some/resource");
        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
View Full Code Here

Examples of org.apache.http.client.fluent.Response.returnResponse()

        running(server, new Runnable() {
            @Override
            public void run() throws Exception {
                Response response = Request.Get(root()).version(HttpVersion.HTTP_1_0).addHeader("Connection", "keep-alive").execute();
                String connection = response.returnResponse().getFirstHeader("Connection").getValue();
                assertThat(connection, is("keep-alive"));
            }
        });
    }
View Full Code Here

Examples of org.apache.http.client.fluent.Response.returnResponse()

        running(server, new com.github.dreamhead.moco.Runnable() {
            @Override
            public void run() throws Exception {
                Response response = Request.Get(root()).version(HttpVersion.HTTP_1_1).addHeader("Connection", "keep-alive").execute();
                assertThat(response.returnResponse().getFirstHeader("Connection"), nullValue());
            }
        });
    }

    @Test
View Full Code Here

Examples of org.apache.http.client.fluent.Response.returnResponse()

        running(server, new Runnable() {
            @Override
            public void run() throws Exception {
                Response response = Request.Get(root()).addHeader("Connection", "close").execute();
                assertThat(response.returnResponse().getFirstHeader("Connection"), nullValue());
            }
        });
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.