Out of the box, the test suite runs a Docker container using TestContainers by default.
Since DB2 container takes about 2 minutes to start, it is good to reuse containers across multiple runs. To container reuse, create a file at ~/.testcontainers.properties
and add the following property:
~/.testcontainers.properties
testcontainers.reuse.enable=true
Just run the following Maven command:
mvn test
If you want to use an external database, you must set the following environment variables:
-
DB2_HOST: The hostname of the machine where DB2 is
-
DB2_PORT: The port DB2 is running on
-
DB2_NAME: The name of the DB2 database instance
-
DB2_USER: The DB2 username
-
DB2_PASS: The DB2 password
If you want to run the automated tests against an external database, you must manually populate it with the data in src/test/resources/init.sql