summaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
diff options
context:
space:
mode:
authorputhuparambil.aditya <aditya.puthuparambil@bell.ca>2021-02-05 17:43:58 +0000
committerputhuparambil.aditya <aditya.puthuparambil@bell.ca>2021-02-08 11:00:57 +0000
commit355ed99c7305beee02fe05c61c4592f1f782a96e (patch)
tree5feda939cc1347e2829919763c1c80e85ba04ef6 /cps-service/src/test
parent63804e8712d1bf9050528f57aedc94909f951ad4 (diff)
E2E Network Slice test for 'Coverage Area-Tracking Area & TA-Cell mapping' with updated data
Issue-ID: CPS-199 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: Ic399198bd583217d96d0f5306078563b23ae54fd
Diffstat (limited to 'cps-service/src/test')
-rwxr-xr-xcps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy20
-rw-r--r--cps-service/src/test/resources/e2e/basic/Data.txt42
-rw-r--r--cps-service/src/test/resources/e2e/basic/cps-Cavsta-Data.txt25
-rw-r--r--cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang6
4 files changed, 45 insertions, 48 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
index 8abc0bf231..ac4ef278ee 100755
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation. All rights reserved.
+ * Modifications Copyright (C) 2021 Bell Canada.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,8 +74,9 @@ class E2ENetworkSliceSpec extends Specification {
def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(
'e2e/basic/cps-cavsta-onap-internal2021-01-28.yang')
def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext()
+ def dataNodeStored
and : 'a valid json is provided for the model'
- def jsonData = TestUtils.getResourceFileContent('e2e/basic/Data.txt')
+ def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-Cavsta-Data.txt')
and : 'all the further dependencies are mocked '
mockCpsAdminService.getAnchor(dataspaceName, anchorName) >>
new Anchor().builder().name(anchorName).schemaSetName(schemaSetName).build()
@@ -84,8 +86,20 @@ class E2ENetworkSliceSpec extends Specification {
when: 'saveData method is invoked'
cpsDataServiceImple.saveData(dataspaceName, anchorName, jsonData)
then: 'Parameters are validated and processing is delegated to persistence service'
- 1 * mockDataStoreService.storeDataNode(dataspaceName, anchorName,
- {dataNode -> dataNode.xpath == '/ran-coverage-area' && dataNode.childDataNodes.size() == 4})
+ 1 * mockDataStoreService.storeDataNode('someDataspace', 'someAnchor', _) >>
+ { args -> dataNodeStored = args[2]}
+ def child = dataNodeStored.childDataNodes[0]
+ assert child.childDataNodes.size() == 1
+ and: 'list of Tracking Area for a Coverage Area are stored with correct xpath and child nodes '
+ def listOfTAForCoverageArea = child.childDataNodes[0]
+ listOfTAForCoverageArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +
+ 'coverage-area[@coverageArea=\'Washington\']'
+ listOfTAForCoverageArea.childDataNodes[0].leaves.get('nRTAC') == 234
+ and: 'list of cells in a tracking area are stored with correct xpath and child nodes '
+ def listOfCellsInTrackingArea = listOfTAForCoverageArea.childDataNodes[0]
+ listOfCellsInTrackingArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +
+ 'coverage-area[@coverageArea=\'Washington\']/coverageAreaTAList[@nRTAC=\'234\']'
+ listOfCellsInTrackingArea.childDataNodes[0].leaves.get('cellLocalId') == 15709
}
def 'E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed for RAN inventory.'() {
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
index c10c6d9c7c..0000000000
--- a/cps-service/src/test/resources/e2e/basic/Data.txt
+++ /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
index 0000000000..bbd3dd1724
--- /dev/null
+++ b/cps-service/src/test/resources/e2e/basic/cps-Cavsta-Data.txt
@@ -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
diff --git a/cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang b/cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang
index 2a8a925798..32517398a3 100644
--- a/cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang
+++ b/cps-service/src/test/resources/e2e/basic/cps-cavsta-onap-internal2021-01-28.yang
@@ -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";
}
-
+ }
+
+
}
}