In previous chapters, we have discussed how to create a REST API and apply the business logic inside our REST APIs and service methods. However, in order to be sure of our business logic, we may need to write proper test cases and use other testing methods. Testing our REST APIs will help us keep our application clean and functional when it is deployed in production. The more we write unit test cases or other testing methods, the better it is for us to maintain our application in the future.
In this chapter, we will discuss the following testing strategies for our sample RESTful web services:
- JUnit testing on Spring controllers
- MockMvc (mocking on controllers)
- Postman REST client
- SoapUI REST client
- jsoup reader as a client