Database Integration Testing with Testcontainers

Introduction to Testcontainers In this post we'll look at Testcontainers and how it can be used to spin up throwaway test databases for your integration tests. You'll see that Testcontainers offers an excellent alternative to in memory databases, such as H2. In memory databases have benefits in terms of speed and simplicity, but there's one fundamental drawback. Your integration tests use a database technology that is substantially different to the one your application will use in production. Testcontainers allows you to spin up the database of your choice, so that your persistence tests run against the same database technology that you'll use in production. This makes [...]

By |2021-10-27T23:29:49+01:00October 27th, 2021|Containerisation, Spring Boot, Testing|0 Comments

Build, Package and Run Spring Boot Apps with Docker

I've recently started playing around with Docker again and have decided to put together a few posts to share what I've learned. In this post  I'll show you how to compile, package and run a simple Spring Boot app in a Docker container. To keep the Docker image as small as possible I'll be using Alpine base images and a multi stage build. Why should I consider using Docker? Docker is a containerization technology that allows you to build an image containing your application and all the dependencies required to run it. The image is a deployable artefact and can be used to run containers [...]

By |2019-10-02T07:43:57+01:00October 1st, 2019|Containerisation, Docker|0 Comments
Go to Top