简体   繁体   English

多个Web服务的存根策略?

[英]Stubbing strategy for multiple web services?

We have a business heavy front end to a light web service that interacts with many other web services. 我们有一个轻量级Web服务的繁重前端,该服务与许多其他Web服务进行交互。

Rather than spinning up 4+ applications each time we're developing something on any of the services we want to have a stubbing framework, one that can be reused for most of the services, allowing for a development (& hopefully reusable for testing) in somewhat isolation. 而不是每次我们在要使用存根框架的任何服务上开发某些东西时都要分解4个以上的应用程序,而是可以将其重用于大多数服务,从而允许在其中进行开发(并希望可重用于测试)。有点孤立。

So stubbing the http requests seems like the best strategy. 因此,对http请求进行存根似乎是最好的策略。

I've been looking at Mockey , Stubby4j & Wiremock (can't post more links) but wanted to ask for Overflow's perspective and see if those who had gone through a similar challenge had any advice. 我一直在看MockeyStubby4j和Wiremock(无法发布更多链接),但想询问Overflow的观点,看看那些经历过类似挑战的人是否有任何建议。

I've been using WireMock recently and am very impressed -- it allows very declarative expression of stubbed responses, and verification of requests. 我最近一直在使用WireMock,并且给我留下了深刻的印象-它允许以简明的方式表达存根响应,并验证请求。 It's like Mockito for HTTP. 就像HTTP的Mockito。 That being said, my use has been primarily in unit and integration tests, and it sounds like you plan on using it as a fake for local development. 话虽如此,我的使用主要用于单元测试和集成测试,听起来您打算将其用作本地开发的伪造品。 I suppose it should still work in your case, but I'd be curious to see how well it holds up in practice. 我想它仍然可以在您的情况下工作,但是我很想知道它在实践中的表现如何。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM