CPS-635 - modified dataspace name for saving schema-set and anchor 22/124022/1
authorJosephKeenan <joseph.keenan@est.tech>
Fri, 10 Sep 2021 10:17:44 +0000 (11:17 +0100)
committerJosephKeenan <joseph.keenan@est.tech>
Fri, 10 Sep 2021 10:17:51 +0000 (11:17 +0100)
Issue-ID: CPS-635

Change-Id: Iaaaefd24ed9f13db7e1d76fd1295b44cc861b83f
Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy

index 4560f8a..24203c0 100755 (executable)
@@ -384,10 +384,10 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
         final Map<String, String> newYangResourcesModuleNameToContentMap =
             getNewYangResources(cmHandle, requestBodyAsJson.toString());
 
         final Map<String, String> newYangResourcesModuleNameToContentMap =
             getNewYangResources(cmHandle, requestBodyAsJson.toString());
 
-        cpsModuleService.createSchemaSetFromModules(NCMP_DATASPACE_NAME, cmHandle.getId(),
+        cpsModuleService.createSchemaSetFromModules(NF_PROXY_DATASPACE_NAME, cmHandle.getId(),
             newYangResourcesModuleNameToContentMap, existingModuleReferences);
 
             newYangResourcesModuleNameToContentMap, existingModuleReferences);
 
-        cpsAdminService.createAnchor(NCMP_DATASPACE_NAME, cmHandle.getId(), cmHandle.getId());
+        cpsAdminService.createAnchor(NF_PROXY_DATASPACE_NAME, cmHandle.getId(), cmHandle.getId());
     }
 
     private JsonObject getRequestBodyAsJson(final List<ModuleReference> unknownModuleReferences) {
     }
 
     private JsonObject getRequestBodyAsJson(final List<ModuleReference> unknownModuleReferences) {
index 98a3aae..3ebb455 100644 (file)
@@ -34,7 +34,6 @@ import org.onap.cps.ncmp.api.impl.operation.DmiOperations
 import org.onap.cps.ncmp.api.models.CmHandle
 import org.onap.cps.ncmp.api.models.DmiPluginRegistration
 import org.onap.cps.ncmp.api.models.PersistenceCmHandle
 import org.onap.cps.ncmp.api.models.CmHandle
 import org.onap.cps.ncmp.api.models.DmiPluginRegistration
 import org.onap.cps.ncmp.api.models.PersistenceCmHandle
-import org.onap.cps.ncmp.api.models.PersistenceCmHandlesList
 import org.onap.cps.ncmp.utils.TestUtils
 import org.onap.cps.spi.FetchDescendantsOption
 import org.onap.cps.spi.model.DataNode
 import org.onap.cps.ncmp.utils.TestUtils
 import org.onap.cps.spi.FetchDescendantsOption
 import org.onap.cps.spi.model.DataNode
@@ -65,7 +64,6 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
     def noTimestamp = null
     def cmHandleXPath = "/dmi-registry/cm-handles[@id='testCmHandle']"
     def cmHandleForModelSync = new PersistenceCmHandle(id:'some cm handle', dmiServiceName: 'some service name')
     def noTimestamp = null
     def cmHandleXPath = "/dmi-registry/cm-handles[@id='testCmHandle']"
     def cmHandleForModelSync = new PersistenceCmHandle(id:'some cm handle', dmiServiceName: 'some service name')
-    def expectedDataspaceNameForModleSync = 'NCMP-Admin'
 
     def expectedDataspaceName = 'NFP-Operational'
     def 'Query data nodes by cps path with #fetchDescendantsOption.'() {
 
     def expectedDataspaceName = 'NFP-Operational'
     def 'Query data nodes by cps path with #fetchDescendantsOption.'() {
@@ -366,9 +364,9 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
         when: 'module Sync is triggered'
             objectUnderTest.createAnchorAndSyncModel(cmHandleForModelSync)
         then: 'the CPS module service is called once with the correct parameters'
         when: 'module Sync is triggered'
             objectUnderTest.createAnchorAndSyncModel(cmHandleForModelSync)
         then: 'the CPS module service is called once with the correct parameters'
-            1 * mockCpsModuleService.createSchemaSetFromModules(expectedDataspaceNameForModleSync, cmHandleForModelSync.getId(), expectedYangResourceToContentMap, [knownModule1])
+            1 * mockCpsModuleService.createSchemaSetFromModules(expectedDataspaceName, cmHandleForModelSync.getId(), expectedYangResourceToContentMap, [knownModule1])
         and: 'admin service create anchor method has been called with correct parameters'
         and: 'admin service create anchor method has been called with correct parameters'
-            1 * mockCpsAdminService.createAnchor(expectedDataspaceNameForModleSync, cmHandleForModelSync.getId(), cmHandleForModelSync.getId())
+            1 * mockCpsAdminService.createAnchor(expectedDataspaceName, cmHandleForModelSync.getId(), cmHandleForModelSync.getId())
         where: 'the following responses are recieved from SDNC'
             scenario             | sdncReponseBody                                                                        || expectedYangResourceToContentMap
             'one unknown module' | '[{"moduleName" : "someModule", "revision" : "1","yangSource": "[some yang source]"}]' || [someModule: 'some yang source']
         where: 'the following responses are recieved from SDNC'
             scenario             | sdncReponseBody                                                                        || expectedYangResourceToContentMap
             'one unknown module' | '[{"moduleName" : "someModule", "revision" : "1","yangSource": "[some yang source]"}]' || [someModule: 'some yang source']