简体   繁体   English

.Net中两个微服务之间的REST API集成测试

[英]integration test in .Net for rest api between two microservices

What is the proper way to perform an integration test between two microservices that communicate between them self in REST API? 在REST API中彼此通信的两个微服务之间执行集成测试的正确方法是什么?

Say I want to post data from one microservice to another, how can I mock the sending from one point and receiving it on the other end, and be able to validate that the data is correct. 假设我想将数据从一个微服务发布到另一个微服务,我该如何模拟从一个点发送并在另一端接收它,并能够验证数据是否正确。

What is the right way of doing that, in .Net if possible? 如果可能的话,在.Net中正确的做法是什么?

I don't know if I understand you right? 我不知道我是否明白你的意思?

But as you describe I think you can just Add Reference to your controller and call the method that you want to test. 但是正如您所描述的,我认为您可以仅向控制器添加引用并调用要测试的方法。

Best Regards 最好的祝福

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

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