7.3. Functional testing of REST services with Spock
Moving up in the testing pyramid, you leave integration tests behind and reach functional tests. Functional tests, depicted in figure 7.8, view the whole system as a black box (in contrast with integration tests that deal with internal modules).
Figure 7.8. A functional test sends a request and expects a certain response.
For non-interactive systems (those with no user-visible component), functional testing involves the testing of the services they provide to the outside world. In practice, this usually means testing the HTTP/REST endpoints of the back-end modules.
REST services use JSON or XML ...
Get Java Testing with Spock 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.