Forum Discussion
https://www.youtube.com/watch?v=L2SMZ9bbDvE
Thank you Rao.
Your video is helpful with setting up the MOCK REST service.
Is there a way to also use SoapUI to test the service, rather than using Postman?
Mike
- nmrao7 years agoChampion Level 3The video was about using SoapUI only, right?
In case, you need to know how to call the service (either live rest service or mock one), check below video:
https://www.youtube.com/watch?v=XV7WW0bDy9c- mtarullo7 years agoOccasional Contributor
Thank you Rao.
I figured out a solution to my problem. I'm not sure if it's the right way to do it, but it seems to work just fine.
Anyone out there with a similar question, here is a summary of what I did:
I had a WADL for a REST service that has not yet been implemented. It will be my responsibility to test it once it is implemented. So I wanted to start getting familiar with the interface before the service was actually ready. I thought the MOCK REST service feature might be just what I was looking for.
I created a REST service from the WADL I had. Then I noticed the "Generate MOCK REST service" menu item. I used it to generate a MOCK REST service from the REST service I created from the WADL.
But then I was having trouble executing the MOCK REST service using the REST service from the WADL as the underlying service. After playing with it for two days I tried something. First I changed the URL in the WADL for the resource in the service to my local machine name. Then I recreated the service from the changed WADL. After I used "Generate MOCK REST service" to recreate the MOCK service I changed the port number generated to match the port I used in the WADL. Then I created a test suite and test case in the project that contains both the service and the MOCK service. I added a response to the MOCK services and then added an assertion to the request test step in my test case. I made the assertion validate the response I wrote for the MOCK service, started up the MOCK service and ran the test case. It worked perfectly!
The last thing I did was figure out how to run different test cases using the same request from the REST service I created with the WADL and using different actions I created with different resources for the MOCK service and different test cases I created in the original test suite. Each time I ran a test case I would simply change the resource for the REST service request to match the resource for the specific MOCK REST service response I wanted to test.
I hope this helps anyone else that wants to do something similar.
Mike
Related Content
Recent Discussions
- 16 hours agogroovyguy