summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlukegleeson <luke.gleeson@est.tech>2022-06-23 12:33:24 +0100
committerlukegleeson <luke.gleeson@est.tech>2022-06-23 14:40:30 +0100
commite29bcb8c8959ba69cf1f80c9daae4794df03299f (patch)
tree20425f0e1bc6f6d03575d4469a41fbb4a6e6f197
parent40a8211b8f8f4b244b43620776a71371bc5371d6 (diff)
Introducing DELETING and DELETED Cmhandle State
Issue-ID: CPS-1101 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I527b47cd98150a753c0d7ba89332a52b414b6834
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json2
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java2
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy7
3 files changed, 6 insertions, 5 deletions
diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
index 05a0e93b3..235a6aa72 100644
--- a/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
@@ -67,7 +67,7 @@
"cmhandle-state": {
"description": "State of cmHandle.",
"type": "string",
- "enum": ["ADVISED", "READY", "LOCKED"]
+ "enum": ["ADVISED", "READY", "LOCKED", "DELETING", "DELETED"]
},
"cmhandle-properties": {
"description": "cmHandle properties as json object.",
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java
index 0c16adca9..7628c81dd 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java
@@ -21,5 +21,5 @@
package org.onap.cps.ncmp.api.inventory;
public enum CmHandleState {
- ADVISED, READY, LOCKED
+ ADVISED, READY, LOCKED, DELETING, DELETED
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
index 578225e87..8c23b302c 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
@@ -141,9 +141,10 @@ class InventoryPersistenceSpec extends Specification {
then: 'update node leaves is invoked with the correct params'
1 * mockCpsDataService.replaceNodeTree('NCMP-Admin', 'ncmp-dmi-registry', '/dmi-registry/cm-handles[@id=\'Some-Cm-Handle\']', expectedJsonData, _ as OffsetDateTime)
where: 'the following states are used'
- scenario | cmHandleState || expectedJsonData
- 'READY' | CmHandleState.READY || '{"state":{"cm-handle-state":"READY","last-update-time":"2022-12-31T20:30:40.000+0000"}}'
- 'LOCKED' | CmHandleState.LOCKED || '{"state":{"cm-handle-state":"LOCKED","last-update-time":"2022-12-31T20:30:40.000+0000"}}'
+ scenario | cmHandleState || expectedJsonData
+ 'READY' | CmHandleState.READY || '{"state":{"cm-handle-state":"READY","last-update-time":"2022-12-31T20:30:40.000+0000"}}'
+ 'LOCKED' | CmHandleState.LOCKED || '{"state":{"cm-handle-state":"LOCKED","last-update-time":"2022-12-31T20:30:40.000+0000"}}'
+ 'DELETING' | CmHandleState.DELETING || '{"state":{"cm-handle-state":"DELETING","last-update-time":"2022-12-31T20:30:40.000+0000"}}'
}
def 'Get Cm Handles By State'() {