This demo project showcases the execution of integration tests using Liquibase, even in the absence of Testcontainers or Docker. The primary objectives of the project are twofold:
- Conducting integration tests efficiently by leveraging Liquibase to set up databases, often of a complex nature.
- Executing tests against pre-installed instances of the Oracle Database, a common scenario in many companies.
Note: Despite the emphasis on point 2, the project includes a docker-compose script to facilitate running the Oracle Instance.
- Docker or any Oracle Instance
- JDK 17, make sure that the JAVA_HOME environment variable is properly configured
These are the prerequisites that should be completed once before running the integration tests.
This method involves starting a preconfigured database instance as a Docker container. From the project directory, run the following command:
docker-compose up -d oracle
⏳ The Docker image is downloaded during the first build, so it may take a little longer than usual.
If you choose this approach, both the database instance and the required adminuser
user are created automatically when
the Oracle container starts.
If you have your own local Oracle setup, you should create an adminuser
. To do that, execute the script
./database/src/main/resources/init/users.sql using a user with the DBA
role. This user is utilized by the integration tests to set up all the necessary database objects on the fly. This step
is automatic when running the Oracle Container.
Once you have the Oracle instance configured, you can run the integration tests:
./gradlew build intest
Przemek Malirz's VShop application on GitHub
Oracle Container Registry - Docker Image Documentation
Getting Started with Liquibase and Gradle