jQuery in Action, 3rd edition
The moose likes Web Services and the fly likes Webservice mockito testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice mockito testing" Watch "Webservice mockito testing" New topic

Webservice mockito testing

Sameer Nagarhalli

Joined: Oct 31, 2011
Posts: 1

Hi to all,

I need some help on Webservice unit testing.
My requirement is to test the functionality for sync and async calls to the webservice.
for sync i need to verify for 200 Ok response and for async i should expect null.
The implementation is done for this, only the testing part is remaining and that should be done thru mockito/powermock.
I need your help on how to begin this.....

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I am not entirely sure, but it sounds like you want to test the client of the web service.
If that is the case and assuming you are using generated client artifacts of some sort, then you should have no problem mocking the web service client stub using your favourite mocking framework.
Generated artifacts usually contain a service interface, which I would use to create a mock stub. There are no details in your questions, so I cannot give a more in-depth answer, I am afraid.
Best wishes!

My free books and tutorials: http://www.slideshare.net/krizsan
I agree. Here's the link: http://aspose.com/file-tools
subject: Webservice mockito testing
It's not a secret anymore!