summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/test/resources
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2020-12-08 14:06:14 +0000
committerGerrit Code Review <gerrit@onap.org>2020-12-08 14:06:14 +0000
commitb5056a392694c50d26d69e587cc55a04a2af04bd (patch)
tree3aa6dbaeabe3395205de88d961cda0b427cadf79 /cps-ri/src/test/resources
parent9647834359b168ed8091cecaecd363cb87abe874 (diff)
parent7cca0296e855bbfaff7d14769db2fc76c5c06892 (diff)
Merge "Persistence layer testing incl CpsModulePersistenceService testing"
Diffstat (limited to 'cps-ri/src/test/resources')
-rw-r--r--cps-ri/src/test/resources/application.yml13
-rw-r--r--cps-ri/src/test/resources/data/clear-all.sql5
-rw-r--r--cps-ri/src/test/resources/data/schemaset.sql14
3 files changed, 32 insertions, 0 deletions
diff --git a/cps-ri/src/test/resources/application.yml b/cps-ri/src/test/resources/application.yml
new file mode 100644
index 0000000000..f6a5dfb0df
--- /dev/null
+++ b/cps-ri/src/test/resources/application.yml
@@ -0,0 +1,13 @@
+spring:
+ jpa:
+ ddl-auto: create
+ properties:
+ hibernate:
+ enable_lazy_load_no_trans: true
+ dialect: org.hibernate.dialect.PostgreSQLDialect
+ datasource:
+ url: ${DB_URL}
+ username: ${DB_USERNAME}
+ password: ${DB_PASSWORD}
+ driverClassName: org.postgresql.Driver
+ initialization-mode: always
diff --git a/cps-ri/src/test/resources/data/clear-all.sql b/cps-ri/src/test/resources/data/clear-all.sql
new file mode 100644
index 0000000000..3d93825ba1
--- /dev/null
+++ b/cps-ri/src/test/resources/data/clear-all.sql
@@ -0,0 +1,5 @@
+-- clear all via dataspace table cleanup
+-- all other data will be removed by cascade
+DELETE FROM DATASPACE;
+-- explicit clear
+DELETE FROM YANG_RESOURCE;
diff --git a/cps-ri/src/test/resources/data/schemaset.sql b/cps-ri/src/test/resources/data/schemaset.sql
new file mode 100644
index 0000000000..23788c3c00
--- /dev/null
+++ b/cps-ri/src/test/resources/data/schemaset.sql
@@ -0,0 +1,14 @@
+INSERT INTO DATASPACE (ID, NAME) VALUES
+ (1001, 'DATASPACE-001'), (1002, 'DATASPACE-002');
+
+INSERT INTO SCHEMA_SET (ID, NAME, DATASPACE_ID) VALUES
+ (2001, 'SCHEMA-SET-001', 1001), (2002, 'SCHEMA-SET-002', 1001);
+
+INSERT INTO YANG_RESOURCE (ID, CONTENT, CHECKSUM) VALUES
+ (3001, 'CONTENT-001', '877e65a9f36d54e7702c3f073f6bc42b'),
+ (3002, 'CONTENT-002', '88892586b1f23fe8c1595759784a18f8'),
+ (3003, 'CONTENT-003', 'fc5740499a09a48e0c95d6fc45d4bde8'),
+ (3004, 'CONTENT-004', '3801280fe532f5cbf535695cf6122026');
+
+INSERT INTO SCHEMA_SET_YANG_RESOURCES (SCHEMA_SET_ID, YANG_RESOURCE_ID) VALUES
+ (2001, 3001), (2001, 3002), (2002, 3003), (2002, 3004);