JUnit test example with Couchbase in a Docker container and TestContainers.
TestContainers allow you to run a container before tests, either for all the class or each methods. This example runs a container with Couchbase Server preconfigured and loaded with the beer-sample. Than test the beer-sample. To run this test successfuly you need to build the DockerFile at the root with the tag 'mycouchbase:latest'.
docker build -t mycouchbase:latest
gradle build
The GenericContainer is used with a custom wait strategy. It wait for the HTTP endpoint /pools/default
to be accessible and for the node to have the healthy
status.