summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/test
diff options
context:
space:
mode:
authorniamhcore <niamh.core@est.tech>2021-09-17 10:30:56 +0100
committerniamhcore <niamh.core@est.tech>2021-09-20 10:57:20 +0100
commit052b755e28b160ed26676e720ed922e5a83c300a (patch)
treecae4336a49f0aacd8c69f9f5abe2bb6ae3f04aa4 /cps-ri/src/test
parentd94ebf2772bff3980941a80ae2e20521181510e3 (diff)
Updating fetch all yang modules queries and tests
Issue-ID: CPS-670 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I11e6da303320aea096a135eb93e270a5fd014740
Diffstat (limited to 'cps-ri/src/test')
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy3
-rw-r--r--cps-ri/src/test/resources/data/schemaset.sql8
2 files changed, 6 insertions, 5 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy
index 7e42200799..a223e7135f 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceIntegrationSpec.groovy
@@ -154,8 +154,7 @@ class CpsModulePersistenceServiceIntegrationSpec extends CpsPersistenceSpecBase
when: 'all yang resources module references are retrieved for the given anchor'
def result = objectUnderTest.getYangResourceModuleReferences(dataspaceName, anchorName)
then: 'the correct module names and revisions are returned'
- result.sort() == [new ModuleReference(moduleName: null, revision: null), new ModuleReference(moduleName: 'MODULE-NAME-002', revision: 'REVISION-002'),
- new ModuleReference(moduleName: 'MODULE-NAME-003', revision: 'REVISION-002'),
+ result.sort() == [ new ModuleReference(moduleName: 'MODULE-NAME-003', revision: 'REVISION-002'),
new ModuleReference(moduleName: 'MODULE-NAME-004', revision: 'REVISION-004')]
}
diff --git a/cps-ri/src/test/resources/data/schemaset.sql b/cps-ri/src/test/resources/data/schemaset.sql
index 61600356b9..2b0a8961b6 100644
--- a/cps-ri/src/test/resources/data/schemaset.sql
+++ b/cps-ri/src/test/resources/data/schemaset.sql
@@ -29,7 +29,8 @@ INSERT INTO SCHEMA_SET (ID, NAME, DATASPACE_ID) VALUES
(2100, 'SCHEMA-SET-100', 1001), -- for removal, not referenced by anchors
(2101, 'SCHEMA-SET-101', 1001), -- for removal, having anchor and data associated
(2003, 'SCHEMA-SET-003', 1002),
- (2004, 'SCHEMA-SET-004', 1002);
+ (2004, 'SCHEMA-SET-004', 1002),
+ (2005, 'SCHEMA-SET-005', 1001);
INSERT INTO YANG_RESOURCE (ID, NAME, CONTENT, CHECKSUM, MODULE_NAME, REVISION) VALUES
(3001, 'module1@2020-02-02.yang', 'CONTENT-001', 'e8bdda931099310de66532e08c3fafec391db29f55c81927b168f6aa8f81b73b',null,null),
@@ -42,14 +43,15 @@ INSERT INTO YANG_RESOURCE (ID, NAME, CONTENT, CHECKSUM, MODULE_NAME, REVISION) V
INSERT INTO SCHEMA_SET_YANG_RESOURCES (SCHEMA_SET_ID, YANG_RESOURCE_ID) VALUES
(2001, 3001), (2001, 3002),
- (2002, 3003), (2002, 3004),
+ (2002, 3003), (2005, 3004),
(2100, 3003), (2100, 3100), -- orphan removal case
(2101, 3003), (2101, 3004),
(2003, 3005), (2004, 3006);
INSERT INTO ANCHOR (ID, NAME, DATASPACE_ID, SCHEMA_SET_ID) VALUES -- anchors for removal
(6001, 'ANCHOR1', 1001, 2101),
- (6002, 'ANCHOR2', 1001, 2101);
+ (6002, 'ANCHOR2', 1001, 2101),
+ (6003, 'ANCHOR3', 1001, 2005);
INSERT INTO FRAGMENT (ID, XPATH, ANCHOR_ID, DATASPACE_ID) VALUES
(7001, '/XPATH', 6001, 1001); \ No newline at end of file