Introduction: Driving the Web Layer

Get yourself introduced to what we will learn in this section.

Building and testing web endpoint

In this section, 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 section, 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.

Section goals

In this section, we’re going to cover how to configure and test HTTP endpoints. We will understand how these endpoints serve as gateways for external clients to interact with our applications, facilitating actions and gameplay experiences. We will refine server building, streamline game initialization, and enhance error handling. With a focus on microservice architecture, we will optimize interactions for an immersive gaming experience.

Get hands-on with 1200+ tech skills courses.