From f2823bb6dd1a6c8964d8648c720d9fe177302f7d Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Mon, 10 Sep 2018 23:16:49 +0200
Subject: [PATCH] by default test database is map_viewer (standard production
 db name), it can be configured in /etc/minerva/test-db.properties though

---
 annotation/src/test/resources/test-dataSource.xml       | 4 +++-
 annotation/src/test/resources/test-db.properties        | 2 +-
 converter-SBGNML/src/test/resources/test-dataSource.xml | 4 ++--
 converter-SBGNML/src/test/resources/test-db.properties  | 2 +-
 persist/src/main/resources/dataSource.xml               | 2 +-
 persist/src/test/resources/test-dataSource.xml          | 4 +++-
 persist/src/test/resources/test-db.properties           | 2 +-
 reactome/src/test/resources/test-dataSource.xml         | 4 +++-
 reactome/src/test/resources/test-db.properties          | 2 +-
 rest-api/src/test/resources/test-dataSource.xml         | 4 +++-
 rest-api/src/test/resources/test-db.properties          | 2 +-
 service/src/test/resources/test-dataSource.xml          | 4 +++-
 service/src/test/resources/test-db.properties           | 2 +-
 13 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/annotation/src/test/resources/test-dataSource.xml b/annotation/src/test/resources/test-dataSource.xml
index 85af9016f8..6374a21fde 100644
--- a/annotation/src/test/resources/test-dataSource.xml
+++ b/annotation/src/test/resources/test-dataSource.xml
@@ -9,7 +9,9 @@
 		http://www.springframework.org/schema/context 
 		http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<context:property-placeholder	location="classpath:test-db.properties" />
+	<context:property-placeholder
+		ignore-resource-not-found="true"
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/annotation/src/test/resources/test-db.properties b/annotation/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/annotation/src/test/resources/test-db.properties
+++ b/annotation/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
diff --git a/converter-SBGNML/src/test/resources/test-dataSource.xml b/converter-SBGNML/src/test/resources/test-dataSource.xml
index 4571b58c1b..6374a21fde 100644
--- a/converter-SBGNML/src/test/resources/test-dataSource.xml
+++ b/converter-SBGNML/src/test/resources/test-dataSource.xml
@@ -11,7 +11,7 @@
 
 	<context:property-placeholder
 		ignore-resource-not-found="true"
-		location="classpath:test-db.properties,file:/etc/minerva/db.properties" />
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
@@ -19,7 +19,7 @@
 		class="com.mchange.v2.c3p0.ComboPooledDataSource"
 		destroy-method="close">
 		<property name="driverClass" value="org.postgresql.Driver" />
-		<property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/map_viewer-test" />
+		<property name="jdbcUrl" value="${database.uri}" />
 		<property name="user" value="${database.username}" />
 		<property name="password" value="${database.password}" />
 		<property name="maxPoolSize" value="90" />
diff --git a/converter-SBGNML/src/test/resources/test-db.properties b/converter-SBGNML/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/converter-SBGNML/src/test/resources/test-db.properties
+++ b/converter-SBGNML/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
diff --git a/persist/src/main/resources/dataSource.xml b/persist/src/main/resources/dataSource.xml
index 0a0333182f..6374a21fde 100644
--- a/persist/src/main/resources/dataSource.xml
+++ b/persist/src/main/resources/dataSource.xml
@@ -11,7 +11,7 @@
 
 	<context:property-placeholder
 		ignore-resource-not-found="true"
-		location="classpath:test-db.properties,file:/etc/minerva/db.properties" />
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/persist/src/test/resources/test-dataSource.xml b/persist/src/test/resources/test-dataSource.xml
index 85af9016f8..6374a21fde 100644
--- a/persist/src/test/resources/test-dataSource.xml
+++ b/persist/src/test/resources/test-dataSource.xml
@@ -9,7 +9,9 @@
 		http://www.springframework.org/schema/context 
 		http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<context:property-placeholder	location="classpath:test-db.properties" />
+	<context:property-placeholder
+		ignore-resource-not-found="true"
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/persist/src/test/resources/test-db.properties b/persist/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/persist/src/test/resources/test-db.properties
+++ b/persist/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
diff --git a/reactome/src/test/resources/test-dataSource.xml b/reactome/src/test/resources/test-dataSource.xml
index 85af9016f8..6374a21fde 100644
--- a/reactome/src/test/resources/test-dataSource.xml
+++ b/reactome/src/test/resources/test-dataSource.xml
@@ -9,7 +9,9 @@
 		http://www.springframework.org/schema/context 
 		http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<context:property-placeholder	location="classpath:test-db.properties" />
+	<context:property-placeholder
+		ignore-resource-not-found="true"
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/reactome/src/test/resources/test-db.properties b/reactome/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/reactome/src/test/resources/test-db.properties
+++ b/reactome/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
diff --git a/rest-api/src/test/resources/test-dataSource.xml b/rest-api/src/test/resources/test-dataSource.xml
index 85af9016f8..6374a21fde 100644
--- a/rest-api/src/test/resources/test-dataSource.xml
+++ b/rest-api/src/test/resources/test-dataSource.xml
@@ -9,7 +9,9 @@
 		http://www.springframework.org/schema/context 
 		http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<context:property-placeholder	location="classpath:test-db.properties" />
+	<context:property-placeholder
+		ignore-resource-not-found="true"
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/rest-api/src/test/resources/test-db.properties b/rest-api/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/rest-api/src/test/resources/test-db.properties
+++ b/rest-api/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
diff --git a/service/src/test/resources/test-dataSource.xml b/service/src/test/resources/test-dataSource.xml
index 85af9016f8..6374a21fde 100644
--- a/service/src/test/resources/test-dataSource.xml
+++ b/service/src/test/resources/test-dataSource.xml
@@ -9,7 +9,9 @@
 		http://www.springframework.org/schema/context 
 		http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 
-	<context:property-placeholder	location="classpath:test-db.properties" />
+	<context:property-placeholder
+		ignore-resource-not-found="true"
+		location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
 
 
 	<!-- Data Source Declaration -->
diff --git a/service/src/test/resources/test-db.properties b/service/src/test/resources/test-db.properties
index 8e0d1e79f3..e1edfb39ac 100644
--- a/service/src/test/resources/test-db.properties
+++ b/service/src/test/resources/test-db.properties
@@ -1,3 +1,3 @@
-database.uri=jdbc:postgresql://localhost:5432/map_viewer-test
+database.uri=jdbc:postgresql://localhost:5432/map_viewer
 database.username=map_viewer
 database.password=123qweasdzxc
\ No newline at end of file
-- 
GitLab