Driving the Web Layer
In this chapter, we complete our web application by adding a web endpoint. We will learn how to write HTTP integration tests using the built-in Java HTTP client. We will test-drive the web adapter code that runs this endpoint, using an open source HTTP server framework. This web adapter is responsible for converting HTTP requests into commands we can execute in our domain layer. At the end of the chapter, we will assemble all the pieces of our application into a microservice. The web adapter and database adapters will be linked to the domain model using dependency injection. We will need to run a few manual database commands, install a web client called Postman, and then we can play our game.
In this chapter, we’re going to cover the following main topics:
- Starting a new game
- Playing the game
- Integrating the application
- Using the application