Package com.atlassian.httpclient.api

Examples of com.atlassian.httpclient.api.Request


    {
        when(requestContext.getHostBaseUrl()).thenReturn("http://localhost");
        when(client.invoke("confluence2.exportSpace", Object.class, "", "DS", getEnumRemoteName(ExportType.HTML)))
                .thenReturn(Promises.<Object>toResolvedPromise("http://localhost/export"));

        Request request = mock(Request.class);
        when(httpClient.newRequest("/export")).thenReturn(request);

        final Response response = mock(Response.class);

        ByteArrayInputStream bin = new ByteArrayInputStream(new byte[0]);
        when(response.getStatusCode()).thenReturn(200);
        when(response.getEntityStream()).thenReturn(bin);
        when(request.get()).thenReturn(ResponsePromises.toResponsePromise(Promises.toResolvedPromise(response)));

        Promise<InputStream> ds = confluenceSpaceClient.exportSpace("DS", ExportType.HTML);
        assertEquals(bin, ds.claim());
    }
View Full Code Here

TOP

Related Classes of com.atlassian.httpclient.api.Request

Copyright © 2018 www.massapicom. 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.