...
API Path | Description of Operation | ||
---|---|---|---|
POST/ran-coverage-area | Add a new coverage area for an operator
| ||
GET /ran-coverage-area/pLMNIdList/{mcc}/{mnc}/coverage-area/{coverageArea} | Find list of tracking are for the coverage area
| ||
PUT /ran-inventorycoverage-area/pLMNIdList/{mcc}/{mnc}/coverage-area/{rannfnssiidcoverageArea}/sliceProfilesList/coverageAreaTAList/{nRTAC} | Find list of cells under the tracking area
|
Groovy Test - E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed for RAN inventory
Link to code review: https://gerrit.onap.org/r/c/cps/+/117447117559/23/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
Code Block | ||
---|---|---|
| ||
def 'E2E Coverage Area-Tracking Area & TA-Cell mapping datamodel can be parsed forby RAN inventoryCPS.'() { def result given: 'validValid yang resource as name-to-content map' def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap( 'e2e/basic/cps-cavsta-onap-internal2021-01-28.yang') when: 'Create schema set method is invoked' cpsModuleServiceImpl.createSchemaSet(dataspaceName, schemaSetName, yangResourcesNameToContentMap) then: 'Parameters are validated and processing is delegated to def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap( 'persistence service' 1 * mockModuleStoreService.storeSchemaSet(dataspaceName, schemaSetName, yangResourcesNameToContentMap) } def 'E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed by CPS.'() { given: 'Valid yang resource as name-to-content map' def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap( 'e2e/basic/cps-ran-inventorycavsta-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/cps-ranCavsta-inventory-dataData.txt') and : 'all the further dependencies are mocked ' mockCpsAdminService.getAnchor('someDataspace'dataspaceName, 'someAnchor'anchorName) >> new Anchor().builder().name('someAnchor'anchorName).schemaSetName('someSchemaSet'schemaSetName).build() mockYangTextSchemaSourceSetCache.get('someDataspace'dataspaceName, 'someSchemaSet'schemaSetName) >> YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap) mockModuleStoreService.getYangSchemaResources('someDataspace'dataspaceName, 'someSchemaSet'schemaSetName) >> schemaContext when: 'saveData method is invoked' cpsDataServiceImple.saveData('someDataspace'dataspaceName, 'someAnchor'anchorName, jsonData) then: 'parametersParameters are validated and processing is delegated to persistence service' 1 * mockDataStoreService.storeDataNode('someDataspace', 'someAnchor', _) >> { args -> resultdataNodeStored = args[2]} and: 'the size of the tree is correct' def cpsRanInventorychild = treeToFlatMapByXpath(new HashMap<>(), result) assert cpsRanInventorydataNodeStored.childDataNodes[0] assert child.childDataNodes.size() == 3 1 and: 'ran-inventorylist containsof theTracking correctArea childfor node' a Coverage Area are stored with correct xpath and 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\']child nodes ' def listOfTAForCoverageArea = child.childDataNodes[0] listOfTAForCoverageArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' + 'coverage-area[@coverageArea=\'Washington\']') ranInventory.getChildDataNodes().size( listOfTAForCoverageArea.childDataNodes[0].leaves.get('nRTAC') == 1234 and: 'list of cells in a tracking area are stored ranInventory.getChildDataNodes().find( {it.xpath == sliceProfilesList.xpath}) and: 'sliceProfilesList contains the correct child node' sliceProfilesList.getChildDataNodes().size() == 1 sliceProfilesList.getChildDataNodes().find( {itwith correct xpath and child nodes ' def listOfCellsInTrackingArea = listOfTAForCoverageArea.childDataNodes[0] listOfCellsInTrackingArea.xpath == pLMNIdList.xpath}) and: 'pLMNIdList contains the no child nodes' pLMNIdList.getChildDataNodes().size('/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' + 'coverage-area[@coverageArea=\'Washington\']/coverageAreaTAList[@nRTAC=\'234\']' listOfCellsInTrackingArea.childDataNodes[0].leaves.get('cellLocalId') == 015709 } |