diff options
author | niamhcore <niamh.core@est.tech> | 2021-02-23 15:32:45 +0000 |
---|---|---|
committer | niamhcore <niamh.core@est.tech> | 2021-02-23 15:32:45 +0000 |
commit | 1c840a4e3bc9dc9fe389d460e1bb1c0666614955 (patch) | |
tree | 49e1dd43f260df6023a18a9a81b3fa94b0224e6d /cps-service/src/test/groovy | |
parent | 861ecab596c548d77cc18f1581a992159ada82ee (diff) |
Updating RAN Inventory tests to use the latest model and data
Issue-ID: CPS-200
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I22fbfd66a2f355f38dc4502445df8041ed0db7c5
Diffstat (limited to 'cps-service/src/test/groovy')
-rwxr-xr-x | cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy | 17 |
1 files changed, 11 insertions, 6 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 75c98a82d9..a24bd0af5c 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 @@ -106,7 +106,7 @@ class E2ENetworkSliceSpec extends Specification { def dataNodeStored
given: 'valid yang resource as name-to-content map'
def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(
- 'e2e/basic/cps-ran-inventory.yang')
+ 'e2e/basic/cps-ran-inventory@2021-01-28.yang')
def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext()
and : 'a valid json is provided for the model'
def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-ran-inventory-data.json')
@@ -122,18 +122,23 @@ class E2ENetworkSliceSpec extends Specification { { args -> dataNodeStored = args[2]}
and: 'the size of the tree is correct'
def cpsRanInventory = TestUtils.getFlattenMapByXpath(dataNodeStored)
- assert cpsRanInventory.size() == 3
+ assert cpsRanInventory.size() == 4
and: 'ran-inventory contains the correct child node'
def ranInventory = cpsRanInventory.get('/ran-inventory')
- def sliceProfilesList = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']')
- def pLMNIdList = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']')
+ def ranSlices = cpsRanInventory.get('/ran-inventory/ran-slices[@rannfnssiid=\'14559ead-f4fe-4c1c-a94c-8015fad3ea35\']')
+ def sliceProfilesList = cpsRanInventory.get('/ran-inventory/ran-slices[@rannfnssiid=\'14559ead-f4fe-4c1c-a94c-8015fad3ea35\']/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']')
+ def pLMNIdList = cpsRanInventory.get('/ran-inventory/ran-slices[@rannfnssiid=\'14559ead-f4fe-4c1c-a94c-8015fad3ea35\']/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']')
ranInventory.getChildDataNodes().size() == 1
- ranInventory.getChildDataNodes().find( {it.xpath == sliceProfilesList.xpath})
+ ranInventory.getChildDataNodes().find( {it.xpath == ranSlices.xpath})
+ and: 'ranSlices contains the correct child node'
+ ranSlices.getChildDataNodes().size() == 1
+ ranSlices.getChildDataNodes().find( {it.xpath == sliceProfilesList.xpath})
and: 'sliceProfilesList contains the correct child node'
sliceProfilesList.getChildDataNodes().size() == 1
sliceProfilesList.getChildDataNodes().find( {it.xpath == pLMNIdList.xpath})
- and: 'pLMNIdList contains the no child nodes'
+ and: 'pLMNIdList contains no children'
pLMNIdList.getChildDataNodes().size() == 0
+
}
def 'E2E RAN Schema Model.'(){
|