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

Commit

Permalink
Usage of postgres in test environment for database consistency (#686)
Browse files Browse the repository at this point in the history
* replace h2 db for testing with postgresql  DRAFT

* remove flyway configuration from submission

* add test database config

removed vendor specific location for flyway

* remove unused sql file
  • Loading branch information
ioangut committed Jul 29, 2020
1 parent 14890de commit 932a61f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
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

0 comments on commit 932a61f

Please sign in to comment.