Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservice mockito testing

 
Sameer Nagarhalli
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

thanks
Sameer
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic