There is need to integrate PostgreSQL database into Spring integration tests. Some known tools that might help are (the list is not complete):
- Postgres tescontainers
- Zonky Embedded Postgres
- Embedded PostgreSQL Server by Yandex – This repository has been archived by the owner. It is now read-only. – this project is not being actively maintained anymore
The primary goal is to have a tool that from one hand has some integration with Spring testing framework, thus minimizes any work needed to enable DB support in integration testing, from another hand allows to run an instance of PostgreSQL with minimal prerequisites (like not having docker) and has an ability to execute DB preparation scripts (ideally Liquibase ones)
- Discover tools/libraries -> create a list
- Evaluate their pros/cons
- Chose the best tool
- Prepare some samples and/or real tests in mod-password-validator that use the tool
FOLIO-1845 how RMB based modules run tests that require a PostgreSQL database:
If the DB_* environment variables are set the test uses the connection parameters to an existing database that the developer or the CI has already started: https://github.com/folio-org/raml-module-builder#environment-variables This can be used by developers that don't want to run Docker, for example when using Windows.
If no DB_* environment variables are set RMB based modules use testcontainers.org and Docker to start a PostgreSQL container for tests.