Chapter 8. Testing RESTful Web Services

Testing is an inherent aspect of building commercial software solutions. Indeed, testing should be considered at every step of the development process, and a software package should only be considered ready when the complete test suite is successful.

In this chapter, we will apply the following testing strategies to our sample RESTful web service:

  • Unit testing Spring controllers
  • Mocking
  • Testing security
  • Integration strategies
  • Other forms of testing to consider

Unit testing Spring controllers

Since we declared RESTful endpoints as Java methods with annotations, normal unit testing techniques can be employed. The de facto unit testing library for Java is JUnit. (http://www.junit.org). JUnit is a simple framework used ...

Get Building a RESTful Web Service with Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.