开发者

Mock web service

开发者 https://www.devze.com 2022-12-20 04:53 出处:网络
We have two components: enterprise application X, and Web service Y We want to make our (automated) testing tool that will test application X (that interact with Y) only,

We have two components: enterprise application X, and Web service Y

We want to make our (automated) testing tool that will test application X (that interact with Y) only, and we have not the web service Y available.

Notes:

  • The testing tool will be a desktop application.

  • We Don't want to use another external tools-e.g. SoapUI- for testing (as we want to automate the testing by running one application).

The question is: How we can mock the web service Y in our testing -desktop- application? Does it is easy to mock it by Socket programming, or any开发者_运维技巧 other method/library?

Thanks in advance,


I found a solution in Java 6

web-services-without-ee-containers

thanks


The best solution is to let application X talk to Web service Y using an interface, such as IWebServiceY.

Coupled with Dependency Injection, this allows you to inject a mock of IWebServiceY into application X instead of the real, web service-based implementation of Web Service Y.

0

精彩评论

暂无评论...
验证码 换一张
取 消