aspose file tools*
The moose likes Testing and the fly likes JMock and Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JMock and Web Service" Watch "JMock and Web Service" New topic
Author

JMock and Web Service

Giovanni Esposito
Greenhorn

Joined: Jul 10, 2013
Posts: 1
I am new with Jmock and I have a test case with Web Services that is implemented like i described ahead, however i can't inyect the mock of WebServiceContext and i dont know how i can do that.

Can anybody give me a hand with this... Thank in advance

Marshall Blythe
Ranch Hand

Joined: Feb 26, 2013
Posts: 33
You could add a setter method to your WebServiceBean to allow injection of a WebServiceContext and move the @Resource annotation to this method:



Now you can use JMock to create a mock WebServiceContext and inject it via the setter method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMock and Web Service