From f3d3114d4d4b4df51e8277daa2a2d2e3da2511d0 Mon Sep 17 00:00:00 2001 From: Frederico Date: Wed, 29 Jul 2020 17:24:06 +0200 Subject: [PATCH] Revert "Usage of postgres in test environment for database consistency (#686)" (#688) This reverts commit 932a61fb082e1ecddb7b9d88a61fcb08c7a1e32a. --- common/persistence/pom.xml | 8 ++++---- .../db/specific/h2/V2__createPermissions.sql | 1 + .../src/test/resources/application.yaml | 6 ++++-- services/distribution/pom.xml | 6 ------ .../src/test/resources/application.yaml | 14 ++++++++------ services/submission/pom.xml | 6 ------ .../submission/src/test/resources/application.yaml | 8 ++++++-- 7 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 common/persistence/src/main/resources/db/specific/h2/V2__createPermissions.sql diff --git a/common/persistence/pom.xml b/common/persistence/pom.xml index 9dd03b053b..f067ad341e 100644 --- a/common/persistence/pom.xml +++ b/common/persistence/pom.xml @@ -82,10 +82,10 @@ runtime - org.testcontainers - postgresql - 1.14.3 - test + com.h2database + h2 + 1.4.200 + runtime diff --git a/common/persistence/src/main/resources/db/specific/h2/V2__createPermissions.sql b/common/persistence/src/main/resources/db/specific/h2/V2__createPermissions.sql new file mode 100644 index 0000000000..2f7af07d54 --- /dev/null +++ b/common/persistence/src/main/resources/db/specific/h2/V2__createPermissions.sql @@ -0,0 +1 @@ +-- no permissions on H2 necessary diff --git a/common/persistence/src/test/resources/application.yaml b/common/persistence/src/test/resources/application.yaml index f949742728..1dde9bb9cf 100644 --- a/common/persistence/src/test/resources/application.yaml +++ b/common/persistence/src/test/resources/application.yaml @@ -2,9 +2,11 @@ spring: flyway: enabled: true - locations: classpath:/db/migration + locations: classpath:/db/migration, classpath:/db/specific/{vendor} datasource: - url: jdbc:tc:postgresql:11.8:///databasename?TC_TMPFS=/testtmpfs:rw + url: jdbc:h2:mem:test;MODE=PostgreSQL + driverClassName: org.h2.Driver + platform: h2 test: database: # Use datasource as defined above. diff --git a/services/distribution/pom.xml b/services/distribution/pom.xml index e37632cb75..1ab6d6df30 100644 --- a/services/distribution/pom.xml +++ b/services/distribution/pom.xml @@ -99,12 +99,6 @@ org.springframework.boot spring-boot-starter-aop - - org.testcontainers - postgresql - 1.14.3 - test - diff --git a/services/distribution/src/test/resources/application.yaml b/services/distribution/src/test/resources/application.yaml index 346dbf9b74..d779aec0f1 100644 --- a/services/distribution/src/test/resources/application.yaml +++ b/services/distribution/src/test/resources/application.yaml @@ -55,9 +55,11 @@ services: spring: main: banner-mode: off - flyway: - enabled: true - locations: classpath:db/migration/postgres - jpa: - hibernate: - ddl-auto: validate + datasource: + url: jdbc:h2:mem:test;MODE=PostgreSQL + driverClassName: org.h2.Driver + platform: h2 + test: + database: + # Use datasource as defined above. + replace: none diff --git a/services/submission/pom.xml b/services/submission/pom.xml index 437bbfa3ba..ac670c764b 100644 --- a/services/submission/pom.xml +++ b/services/submission/pom.xml @@ -68,12 +68,6 @@ 2.26.3 test - - org.testcontainers - postgresql - 1.14.3 - test - diff --git a/services/submission/src/test/resources/application.yaml b/services/submission/src/test/resources/application.yaml index 39b2cdd957..dfb4524ff6 100644 --- a/services/submission/src/test/resources/application.yaml +++ b/services/submission/src/test/resources/application.yaml @@ -8,10 +8,14 @@ spring: main: banner-mode: off datasource: - url: jdbc:tc:postgresql:11.8:///databasename?TC_TMPFS=/testtmpfs:rw + url: jdbc:h2:mem:test;MODE=PostgreSQL + driverClassName: org.h2.Driver + platform: h2 test: database: + # Use datasource as defined above. replace: none + services: submission: initial-fake-delay-milliseconds: 1 @@ -47,4 +51,4 @@ feign: config: default: connect-timeout: 500 - read-timeout: 500 + read-timeout: 500 \ No newline at end of file