.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());
}