pom.xml
<dependency>
<groupId>com.playtika.testcontainers</groupId>
<artifactId>embedded-postgresql</artifactId>
<scope>test</scope>
</dependency>
-
embedded.postgresql.enabled
(true|false, default is 'true')
-
embedded.postgresql.reuseContainer
(true|false, default is 'false')
-
embedded.postgresql.dockerImage
(default is set to 'postgres:9.6.8')
-
You can pick wanted version on dockerhub
-
-
embedded.postgresql.waitTimeoutInSeconds
(default is 60 seconds)
-
embedded.postgresql.database
-
embedded.postgresql.user
-
embedded.postgresql.password
-
embedded.postgresql.initScriptPath
(default is null)
-
embedded.postgresql.startupLogCheckRegex
(default is null)
-
embedded.postgresql.port
-
embedded.postgresql.host
-
embedded.postgresql.schema
-
embedded.postgresql.user
-
embedded.postgresql.password
bootstrap-test.yml
embedded:
postgresql:
enabled: true
docker-image: 'bitnami/postgresql:13.1.0'
wait-timeout-in-seconds: 40
command: '/opt/bitnami/scripts/postgresql/run.sh'
startupLogCheckRegex: '.*database system is ready to accept connections.*'
application-test.yml
spring:
datasource:
url: "jdbc:postgresql://${embedded.postgresql.host}:${embedded.postgresql.port}/${embedded.postgresql.schema}"
username: ${embedded.postgresql.user}
password: ${embedded.postgresql.password}