Testing this service is relatively simple. We can skip unit tests as we are not writing functions suited for those. It makes more sense to write a Postman test suite that will test the API endpoints. In Chapter 8, Testing Microservices you learned how to do that. So, let's apply that here, as follows:
- Open Postman and create a new test suite.
- Set up authentication so that we can test the admin functions as well.
- Go through the preceding routes and add a test for each one of them.
- Let Postman test this service and verify that it works as expected.
You can find the entire test suite in the GitHub repository for this chapter: https://github.com/PacktPublishing/Hands-On-Microservices-with-Swift-5/tree/master/Chapter 9/ProductService
Now that we have tested this service, let's summarize what we have learned.