Summary
In this chapter, we have seen how Docker can be used to simplify testing a landscape of cooperating microservices.
We learned how Java SE, since v10, honors constraints that we put on containers regarding how much CPU and memory they are allowed to use. We have also seen how little it takes to make it possible to run a Java-based microservice as a Docker container. Thanks to Spring profiles, we can run the microservice in Docker without having to make any code changes.
Finally, we have seen how Docker Compose can help us manage a landscape of cooperating microservices with single commands, either manually or, even better, automatically, when integrated with a test script such as test-em-all.bash
.
In the next chapter, we will study how we can add some documentation of the API using OpenAPI/Swagger descriptions.