Moro
Moro

Reputation: 2128

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 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,

Upvotes: 6

Views: 2435

Answers (2)

Moro
Moro

Reputation: 2128

I found a solution in Java 6

web-services-without-ee-containers

thanks

Upvotes: 6

Mark Seemann
Mark Seemann

Reputation: 233150

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.

Upvotes: 2

Related Questions