public ClientResponse execute(ClientRequest request) throws Exception
{
MockHttpRequest mockHttpRequest = MockHttpRequest.create(request.getHttpMethod(), new URI(request.getUri()),
baseUri);
final MockHttpResponse mockResponse = new MockHttpResponse();
mockHttpRequest.setAsynchronousContext(new SynchronousExecutionContext((SynchronousDispatcher)dispatcher, mockHttpRequest, mockResponse));
loadHttpMethod(request, mockHttpRequest);
dispatcher.invoke(mockHttpRequest, mockResponse);
return createResponse(request, mockResponse);
}