Using Throwaway Containers for Integration Testing with Java, JUnit 5 and Testcontainers.

A lot of boilerplate code is written when developers need to test their applications with different connected systems like databases, stream platforms and other collaborators. Docker allows to handle those dependencies but there is still some glue code required to bind the container’s lifecycle and the configuration to the concrete integration test. Testcontainers is a testing library that offers lightweight throwaway instances of anything able to run in a Docker container, with bindings to configure the specific containers and also provides wrappers to manage our own custom containers. ...

January 30, 2019 · 6 min · 1110 words · Micha Kops