Write Maintainable Integration Tests with Docker


The popularity of microservices and the use of third-party services for non-business critical features have drastically increased the number of integrations that make up the modern application. These days, it is commonplace to use MyS QL, Redis as a key-value store, MongoDB, Postgress, and InfluxDB — and that is all just for the database — let alone the multiple services that make up other parts of the application.

All of these integration points require different layers of testing. Unit tests increase how fast you write code because you can mock all of your dependencies, set the expectation for your function, and iterate until you get the desired transformation; however, we need more. We need to make sure that the integration with Redis, MongoDB or a microservice works as expected, not just that the mock works as we wrote it. Both are important, but the difference is huge.