This page covers the groovy tests to test Coverage Area-Tracking Area & TA-Cell mapping model and data. It also cover the queries that the CPS team will need to implement.
- CPS-199Getting issue details... STATUS
Models and data
There was an issue with the original json data provided. We corrected this issue by modifying the root element and the E2E Network Slicing team was notified. The corrected model and data was later received and all cps-test cases passes.
cps-cavsta-onap-internal2021-01-28.yang
Queries used for the RAN inventory model
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 list coverage-area{ uses coverageAreaGroup; key "coverageArea"; description "This list contains the list of coverage area of a PLMNID"; } grouping coverageAreaGroup{ leaf coverageArea{ description "An attribute specifies the coverage area of the network slice, i.e. the geographic region where a 3GPP communication service is accessible, see Table 7.1-1 of TS 22.261 [28]) and NG.116 [50]."; type string; } list coverageAreaTAList{ uses trackingAreaGroup; key "nRTAC"; description "This list contains the tracking area list for the coverageArea"; } }
|
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/+/117374/5/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
def 'E2E Coverage Area-Tracking Area & TA-Cell mapping model can be parsed by CPS.'() { given: 'Valid 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 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-cavsta-onap-internal2021-01-28.yang') def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext() and : 'a valid json is provided for the model' def jsonData = TestUtils.getResourceFileContent('e2e/basic/Data.txt') and : 'all the further dependencies are mocked ' mockCpsAdminService.getAnchor(dataspaceName, anchorName) >> new Anchor().builder().name(anchorName).schemaSetName(schemaSetName).build() mockYangTextSchemaSourceSetCache.get(dataspaceName, schemaSetName) >> YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap) mockModuleStoreService.getYangSchemaResources(dataspaceName, schemaSetName) >> schemaContext 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})