Database tests are the standard server integration tests executed against a real database (MySQL or Postgres) started as Docker containers. The Gradle test task will automatically pull the necessary images and start the containers.
Before running those tests, make sure you have got a working Docker setup:
- Install Docker Desktop or Docker Engine and Docker CLI.
- Enable remote access for the Docker daemon.
You can execute the database tests by running the run configurations provided in the repository:
- For MySQL tests: Artemis Server Tests MySQL.
- For Postgres tests: Artemis Server Tests Postgres.
Or alternatively, by creating a custom configuration. The screenshot below presents an example of such a run configuration:
You can execute the database tests by running the dedicated Gradle command:
- For MySQL tests: SPRING_PROFILES_INCLUDE=mysql ./gradlew cleanTest test -x webapp.
- For Postgres tests: SPRING_PROFILES_INCLUDE=postgres ./gradlew cleanTest test -x webapp.