I am using this example login to build the RESTful part in my application. However, I do not have a server connected. What I want to do is to create a mock service, using an HTTP generator as Mocky (check it). Does anyone know how can this be achieved? Thanks a lot!
Sorry for being so long to answer (little bit busy that week). Well, I hope you haven't given up meanwhile...
So below is the procedure to set up a RESTful mock service :
You can download the Opensource version of SOAP UI here. It's enough for making a simple mock service
Create a new empty Project
Right click on the project and click on "New REST mock service"
Right click on MockService1 and click on "Add new mock action"
Then double-click on /api/v1/user and Add a new mock response (right-click / New Mock response)
It's done. You just need to double-click on "REST MockService1" and run the service (green button)
You can configure the path, port and host :
Once running, you're WebService can be called using this HTTP Request : GET http://localhost:8080/api/v1/users
Much more information on the WebSite : https://www.soapui.org/rest-testing-mocking/rest-service-mocking.html You can for example, define some algorithmes to make your webservice more intelligent and test every case (for example if user is = 1 return 200 OK {user} otherwise return 404 ERROR NOT FOUND, ...)