when(mockResponse.getBody()).thenReturn(new ByteArrayInputStream("Test Body".getBytes()));
when(mockRequest.getHeaders()).thenReturn(new HttpHeaders());
when(mockRequest.getBody()).thenReturn(new ByteArrayOutputStream());
when(mockRequest.execute()).thenReturn(mockResponse);
ClientHttpRequestFactory mockRequestFactory = mock(ClientHttpRequestFactory.class);
when(mockRequestFactory.createRequest(new URI("http://somehost.com/test"), HttpMethod.GET)).thenReturn(mockRequest);
ClientHttpRequestFactory bufferingRequestFactory = ClientHttpRequestFactorySelector.bufferRequests(mockRequestFactory);
ClientHttpRequest request = bufferingRequestFactory.createRequest(new URI("http://somehost.com/test"), HttpMethod.GET);
ClientHttpResponse response = request.execute();
response.getBody();
response.getBody();