春季整合:httprequestexecutingmessagehandler上的模拟请求factory
由于将春季整合升级到5.3.10。我们无法在单位测试中嘲笑httprequestexecutingmessagehandler上的requestFactory,因此实际上检查了是否已调用了请求factory setter,并且在这种情况下抛出了例外。 那么,如何使用Mockito实例配置HttpRequestecectecutingMessageHandler.RequestFactory.RequestFactory?
Since upgrading spring-integration to 5.3.10.RELEASE we can't mock the requestFactory on HttpRequestExecutingMessageHandler anymore in the unit tests, it is actually checked if the requestFactory setter has been called and an exception is thrown in that case.
So, how to configure the HttpRequestExecutingMessageHandler.requestFactory now with a Mockito instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那里的检查是这样的:
这意味着您已经在这个
HttpRequestExecutingMessageHandler
中提供了一个RestTemplate
。requestFactory
本质上是RestTemplate
的一个属性。因此,请考虑将模拟设置为外部RestTemplate
。The check there is like this:
That means that you have been providing a
RestTemplate
into thisHttpRequestExecutingMessageHandler
. TherequestFactory
is essentially a property of theRestTemplate
. So, consider to set your mock into that externalRestTemplate
instead.