15

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 ...

Get Test-Driven Development with Java 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.