From b5e792a0526e2a8cefeb4498bf8a2710201e262d Mon Sep 17 00:00:00 2001 From: Sorin Stefan Iovita Date: Wed, 5 Aug 2020 17:38:56 +0300 Subject: [PATCH] Update 1.3 release (#692) * Revert "Usage of postgres in test environment for database consistency (#686)" (#688) This reverts commit 932a61fb082e1ecddb7b9d88a61fcb08c7a1e32a. * Mitigate CVE-2020-13935 (#690) * Bump spring parent version * Liveness health indicator according to. https://github.com/spring-projects/spring-boot/issues/22107 Co-authored-by: Frederico --- 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/pom.xml | 8 +------- services/submission/pom.xml | 6 ------ .../submission/src/test/resources/application.yaml | 8 +++++++- 8 files changed, 25 insertions(+), 32 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/pom.xml b/services/pom.xml index b65a1a7adb..507e7bcbe7 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -8,7 +8,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.1.RELEASE + 2.3.2.RELEASE @@ -101,12 +101,6 @@ 42.2.13 runtime - - - org.apache.tomcat.embed - tomcat-embed-core - 9.0.37 - 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..71d9af5252 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 @@ -39,6 +43,8 @@ management: exposure: include: 'health' health: + livenessstate: + enabled: true probes: enabled: true