Let’s assume our application uses Keycloak as an identity provider. When writing end-to-end tests, we need a running instance of this identity provider.
With Testcontainers, we can now define a GenericContainer as part of our test setup.
The constructor of this GenericContainer expects and Docker image. For our example, we’ll use the official jboss/keycloak image: