From bb61bf010fdce1aef6a0580243684cad6fb942bf Mon Sep 17 00:00:00 2001 From: JosephKeenan Date: Fri, 10 Sep 2021 11:17:44 +0100 Subject: [PATCH 1/1] CPS-635 - modified dataspace name for saving schema-set and anchor Issue-ID: CPS-635 Change-Id: Iaaaefd24ed9f13db7e1d76fd1295b44cc861b83f Signed-off-by: JosephKeenan --- .../org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 4 ++-- .../onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index 4560f8a1ba..24203c0d7f 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -384,10 +384,10 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService final Map newYangResourcesModuleNameToContentMap = getNewYangResources(cmHandle, requestBodyAsJson.toString()); - cpsModuleService.createSchemaSetFromModules(NCMP_DATASPACE_NAME, cmHandle.getId(), + cpsModuleService.createSchemaSetFromModules(NF_PROXY_DATASPACE_NAME, cmHandle.getId(), 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 unknownModuleReferences) { diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy index 98a3aaed1c..3ebb4550c3 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy @@ -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.PersistenceCmHandlesList 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 expectedDataspaceNameForModleSync = 'NCMP-Admin' 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' - 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' - 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'] -- 2.16.6