Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Usage of postgres in test environment for database consistency #686

Merged
merged 4 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions common/persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
<scope>runtime</scope>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- https://nvd.nist.gov/vuln/detail/CVE-2020-9488 -->
Expand Down

This file was deleted.

6 changes: 2 additions & 4 deletions common/persistence/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
spring:
flyway:
enabled: true
locations: classpath:/db/migration, classpath:/db/specific/{vendor}
locations: classpath:/db/migration
datasource:
url: jdbc:h2:mem:test;MODE=PostgreSQL
driverClassName: org.h2.Driver
platform: h2
url: jdbc:tc:postgresql:11.8:///databasename?TC_TMPFS=/testtmpfs:rw
test:
database:
# Use datasource as defined above.
Expand Down
6 changes: 6 additions & 0 deletions services/distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.14.3</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
14 changes: 6 additions & 8 deletions services/distribution/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ services:
spring:
main:
banner-mode: off
datasource:
url: jdbc:h2:mem:test;MODE=PostgreSQL
driverClassName: org.h2.Driver
platform: h2
test:
database:
# Use datasource as defined above.
replace: none
flyway:
enabled: true
locations: classpath:db/migration/postgres
jpa:
hibernate:
ddl-auto: validate
6 changes: 6 additions & 0 deletions services/submission/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
<version>2.26.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.14.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
8 changes: 2 additions & 6 deletions services/submission/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ spring:
main:
banner-mode: off
datasource:
url: jdbc:h2:mem:test;MODE=PostgreSQL
driverClassName: org.h2.Driver
platform: h2
url: jdbc:tc:postgresql:11.8:///databasename?TC_TMPFS=/testtmpfs:rw
test:
database:
# Use datasource as defined above.
replace: none

services:
submission:
initial-fake-delay-milliseconds: 1
Expand Down Expand Up @@ -51,4 +47,4 @@ feign:
config:
default:
connect-timeout: 500
read-timeout: 500
read-timeout: 500