Introducing DELETING and DELETED Cmhandle State 71/129671/1
authorlukegleeson <luke.gleeson@est.tech>
Thu, 23 Jun 2022 11:33:24 +0000 (12:33 +0100)
committerlukegleeson <luke.gleeson@est.tech>
Thu, 23 Jun 2022 13:40:30 +0000 (14:40 +0100)
Issue-ID: CPS-1101
Signed-off-by: lukegleeson <luke.gleeson@est.tech>
Change-Id: I527b47cd98150a753c0d7ba89332a52b414b6834

cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleState.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy

index 05a0e93..235a6aa 100644 (file)
@@ -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.",
index 578225e..8c23b30 100644 (file)
@@ -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'() {