If you are new to the Play framework and want to learn more about how Play tests are set up, or if you are new to the idea of HTTP integration testing, I encourage you to check out the tutorial I recently wrote for the Semaphore Community.
In the tutorial, I walk you through creating a simple JSON API using a library as the domain example. Then, I show you how to add tests to that API that make actual HTTP calls.
Here’s a preview of the tutorial contents
- Introduction
- Prerequisites
- Setting Up the Application
- Create a New Project
- Add routes
- Add Controllers
- Adding Models and a Repository
- Implementing the Controllers
- Adding Integration Tests
- Testing the Application Index
- Books Controller Tests
- Customer Controller Tests
- Conclusion