The steps to test our insertProduct method are as follows:
- Start the Eureka server, then the product service (assuming it is listening on 8082).
- Note that a browser will not suffice now, as we want to indicate the HTTP methods and provide a response body. Use Postman or cURL instead.
- Set the content-type to application/json, since we will be submitting the new product information as a JSON.
- Provide the production information in JSON format, such as {"name":"Grapes","catId":1}. Note we are not providing a product ID:
- Hit Send. You will get a response with the product JSON. This time, an ID will be populated. This is the ID generated ...