E2E Network Slice test for 'Coverage Area-Tracking Area & TA-Cell mapping' with updat... 59/117559/3
authorputhuparambil.aditya <aditya.puthuparambil@bell.ca>
Fri, 5 Feb 2021 17:43:58 +0000 (17:43 +0000)
committerputhuparambil.aditya <aditya.puthuparambil@bell.ca>
Mon, 8 Feb 2021 11:00:57 +0000 (11:00 +0000)
Issue-ID: CPS-199
Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca>
Change-Id: Ic399198bd583217d96d0f5306078563b23ae54fd

cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
cps-service/src/test/resources/e2e/basic/Data.txt [deleted file]
cps-service/src/test/resources/e2e/basic/cps-Cavsta-Data.txt [new file with mode: 0644]
cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang

index 8abc0bf..ac4ef27 100755 (executable)
@@ -1,6 +1,7 @@
 /*-\r
  * ============LICENSE_START=======================================================\r
  *  Copyright (C) 2021 Nordix Foundation. All rights reserved.\r
+ *  Modifications Copyright (C) 2021 Bell Canada.\r
  * ================================================================================\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -73,8 +74,9 @@ class E2ENetworkSliceSpec extends Specification {
             def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(\r
                     'e2e/basic/cps-cavsta-onap-internal2021-01-28.yang')\r
             def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext()\r
+            def dataNodeStored\r
         and : 'a valid json is provided for the model'\r
-            def jsonData = TestUtils.getResourceFileContent('e2e/basic/Data.txt')\r
+            def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-Cavsta-Data.txt')\r
         and : 'all the further dependencies are mocked '\r
             mockCpsAdminService.getAnchor(dataspaceName, anchorName) >>\r
                     new Anchor().builder().name(anchorName).schemaSetName(schemaSetName).build()\r
@@ -84,8 +86,20 @@ class E2ENetworkSliceSpec extends Specification {
         when: 'saveData method is invoked'\r
             cpsDataServiceImple.saveData(dataspaceName, anchorName, jsonData)\r
         then: 'Parameters are validated and processing is delegated to persistence service'\r
-            1 * mockDataStoreService.storeDataNode(dataspaceName, anchorName,\r
-                    {dataNode -> dataNode.xpath == '/ran-coverage-area' && dataNode.childDataNodes.size() == 4})\r
+            1 * mockDataStoreService.storeDataNode('someDataspace', 'someAnchor', _) >>\r
+                    { args -> dataNodeStored = args[2]}\r
+            def child = dataNodeStored.childDataNodes[0]\r
+            assert child.childDataNodes.size() == 1\r
+        and: 'list of Tracking Area for a Coverage Area are stored with correct xpath and child nodes '\r
+            def listOfTAForCoverageArea = child.childDataNodes[0]\r
+            listOfTAForCoverageArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +\r
+                    'coverage-area[@coverageArea=\'Washington\']'\r
+            listOfTAForCoverageArea.childDataNodes[0].leaves.get('nRTAC') == 234\r
+        and: 'list of cells in a tracking area are stored with correct xpath and child nodes '\r
+            def listOfCellsInTrackingArea = listOfTAForCoverageArea.childDataNodes[0]\r
+            listOfCellsInTrackingArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +\r
+                    'coverage-area[@coverageArea=\'Washington\']/coverageAreaTAList[@nRTAC=\'234\']'\r
+            listOfCellsInTrackingArea.childDataNodes[0].leaves.get('cellLocalId') == 15709\r
     }\r
 \r
     def 'E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed for RAN inventory.'() {\r
diff --git a/cps-service/src/test/resources/e2e/basic/Data.txt b/cps-service/src/test/resources/e2e/basic/Data.txt
deleted file mode 100644 (file)
index c10c6d9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-"ran-coverage-area":{
-  "pLMNIdList": [
-    {
-      "mcc": "310",
-      "mnc": "410"
-    },
-    {
-       "mcc": "2310",
-       "mnc": "2410"
-    }
-  ],
-  "coverage-area": [
-    {
-      "coverageArea": "Washington",
-      "coverageAreaTAList": [
-        {
-          "nRTAC": 234,
-          "taCellsList": [
-            {
-              "cellLocalId": 15709
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "coverageArea": "Dublin",
-      "coverageAreaTAList": [
-        {
-          "nRTAC": 2234,
-          "taCellsList": [
-            {
-              "cellLocalId": 15809
-            }
-          ]
-        }
-      ]
-    }
-  ]
-  }
-}
\ No newline at end of file
diff --git a/cps-service/src/test/resources/e2e/basic/cps-Cavsta-Data.txt b/cps-service/src/test/resources/e2e/basic/cps-Cavsta-Data.txt
new file mode 100644 (file)
index 0000000..bbd3dd1
--- /dev/null
@@ -0,0 +1,25 @@
+{
+"cps-cavsta-onap-internal:ran-coverage-area":{
+  "pLMNIdList": [
+    {
+      "mcc": "310",
+      "mnc": "410",
+      "coverage-area": [
+    {
+      "coverageArea": "Washington",
+      "coverageAreaTAList": [
+        {
+          "nRTAC": 234,
+          "taCellsList": [
+            {
+              "cellLocalId": 15709
+            }
+          ]
+        }
+      ]
+    }
+  ]
+    }
+  ]
+}
+}
\ No newline at end of file
index 2a8a925..3251739 100644 (file)
@@ -140,14 +140,14 @@ module cps-cavsta-onap-internal {
         Mobile Network Code (MNC).";
       key "mcc mnc";
       uses PLMNId;
-    }
 
-      
       list coverage-area{
         uses coverageAreaGroup;
         key "coverageArea";
         description "This list contains the list of coverage area of a PLMNID";
       }
-    
+    }
+
+
     }
     }