Running an Infinispan node in clustered mode using Testcontainers

In my last to blog posts I wrote about a library called Testcontainers. It’s a Java wrapper around docker containers and you can use it to run software that your application depends on in a test context. My last post presented a solution that makes it easier to start up an Infinispan caching server. This solution focused on a standalone Infinispan server. While this is probably good enough most of the time, sometimes you might need a server running in clustered mode. This post shows one solution for this.

Running an Infinispan server using Testcontainers

A few days ago I wrote about a library called Testcontainers. It helps you to run software that your application depends on in a test context by providing an API to start docker containers. Testcontainers comes with a few pre-configured database- and selenium-containers, but most importantly it also provides a generic container that you can use to start whatever docker image you need to.