简体   繁体   English

模拟和模拟虚拟服务有什么区别?

[英]What is the difference between mocking and simulating virtual services?

I have been looking at CodeSV , a free Java library which enables to set up virtual services in unit testing.我一直在看CodeSV ,这是一个免费的 Java 库,可以在单元测试中设置虚拟服务。 I do not quite understand the difference between that and mocking.我不太明白那和嘲笑之间的区别。 According to CodeSV's authors their library can achieve more than mocking.根据 CodeSV 的作者的说法,他们的库可以实现的不仅仅是模拟。 What would be the advantages of one approach against another?一种方法对另一种方法的优势是什么?

I accept the second comment as an answer to my question.我接受第二条评论作为对我问题的回答。

Mock will be used for a Unit Test. Mock 将用于单元测试。

Simulating virtual service will be used for Integration Testing because it is acting as a server and an actual HTTP calls are being made.模拟虚拟服务将用于集成测试,因为它充当服务器并且正在进行实际的 HTTP 调用。

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

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