简体   繁体   中英

Mock web service

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-eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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