我正在尝试构建一个CloseableHttpResponse要在我的单元测试之一中返回的模拟对象,但没有构造函数。我找到了这个DefaultHttpResponseFactory,但它只生成一个HttpResponse。构造CloseableHttpResponse的简单方法是什么?我是否需要在测试中调用execute()然后设置statusLine和entity?这似乎是一种奇怪的方法。这是我试图模拟的方法:publicstaticCloseableHttpResponsegetViaProxy(Stringurl,Stringip,intport,Stringusername,St