aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2021-12-14 16:34:38 +0000
committerDylanB95EST <dylan.byrne@est.tech>2022-01-28 14:32:11 +0000
commit63132cec2c18363a8224646039cc23b6144d8e6c (patch)
tree0821e401a14655ecba60d213f5dbacac12e8f0b4 /cps-service
parenta5ce86d02493f141848f9d609c65883d2198894a (diff)
Support 'public' Cm Handle Properties
Add support for new Public Additional Properties list to Register CM Handles API Issue-ID: CPS-677 Change-Id: I6efc88734da2416f72f71a403622e519398b502d Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-service')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy16
-rw-r--r--cps-service/src/test/resources/dmi-registry.yang42
2 files changed, 8 insertions, 50 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
index 6c899c793..a302eb5e7 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation
+ * Copyright (C) 2021-2022 Nordix Foundation
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2021-2022 Bell Canada.
* ================================================================================
@@ -154,19 +154,19 @@ class CpsDataServiceImplSpec extends Specification {
'one leaf' | '{"name": "some-name"}'
}
- def 'Update cm-handle properties' () {
- given: 'a dmi registry model'
- setupSchemaSetMocks('dmi-registry.yang')
+ def 'Update Bookstore node leaves' () {
+ given: 'a DMI registry model'
+ setupSchemaSetMocks('bookstore.yang')
and: 'the expected json string'
- def jsonData = '{"cm-handles":[{"id":"cmHandle001", "additional-properties":[{"name":"P1"}]}]}'
+ def jsonData = '{"categories":[{"code":01,"name":"Romance"}]}'
when: 'update data method is invoked with json data and parent node xpath'
objectUnderTest.updateNodeLeavesAndExistingDescendantLeaves(dataspaceName, anchorName,
- '/dmi-registry', jsonData, observedTimestamp)
+ '/bookstore', jsonData, observedTimestamp)
then: 'the persistence service method is invoked with correct parameters'
1 * mockCpsDataPersistenceService.updateDataLeaves(dataspaceName, anchorName,
- "/dmi-registry/cm-handles[@id='cmHandle001']", ['id': 'cmHandle001'])
+ "/bookstore/categories[@code='01']", ['name':'Romance', 'code': '01'])
and: 'the data updated event is sent to the notification service'
- 1 * mockNotificationService.processDataUpdatedEvent(dataspaceName, anchorName, observedTimestamp, '/dmi-registry', Operation.UPDATE)
+ 1 * mockNotificationService.processDataUpdatedEvent(dataspaceName, anchorName, observedTimestamp, '/bookstore', Operation.UPDATE)
}
def 'Replace data node: #scenario.'() {
diff --git a/cps-service/src/test/resources/dmi-registry.yang b/cps-service/src/test/resources/dmi-registry.yang
deleted file mode 100644
index 3c2d893b2..000000000
--- a/cps-service/src/test/resources/dmi-registry.yang
+++ /dev/null
@@ -1,42 +0,0 @@
-module dmi-registry {
-
- yang-version 1.1;
-
- namespace "org:onap:cps:ncmp";
-
- prefix dmi-reg;
-
- revision "2021-05-20" {
- description
- "Initial Version";
- }
-
- container dmi-registry {
-
- list cm-handles {
-
- key "id";
-
- leaf id {
- type string;
- }
-
- leaf dmi-service-name {
- type string;
- }
-
- list additional-properties {
-
- key "name";
-
- leaf name {
- type string;
- }
-
- leaf value {
- type string;
- }
- }
- }
- }
-} \ No newline at end of file