This is a Spring Boot application used as an example in my blogs posts, how to use Testcontainers in a Spring Boot project and its integration tests. It shows you how to migrate from an embedded h2 database to a real Mariadb database running in a docker container. After that, how you can get your tests to start much faster.
Read more in my blog posts
This project consists of several directories that contain the application both before and after the changes.
The following directories are available
- the origin directory contains the source code before we migrated our tests from H2 to Testcontainers.
- the solution directory contains the source code after we migrated our tests from H2 to Testcontainers.
- the faster directory contains the source code after doing some changes to make our tests run faster
- Check out the code
$ git clone https://github.com/merikan/testcontainers-demo.git
- cd into the desired directory
$ cd testcontainers-demo/faster
- and run the tests
$ ./mvnw clean test verify
This project is licensed under the terms of the Apache License, Version 2.0.