diff options
author | Rudrangi Anupriya <ra00745022@techmahindra.com> | 2024-07-19 20:20:26 +0530 |
---|---|---|
committer | Sourabh Sourabh <sourabh.sourabh@est.tech> | 2024-08-01 08:57:23 +0000 |
commit | d0d4b973536730744279f176f5bac870b114cf78 (patch) | |
tree | 558696ef4295d72c6ccec9e006b043053ff37a08 /cps-ncmp-service/src | |
parent | 523f3ff8cc25c1b45b5aa5c3b4ad9efd46bba14a (diff) |
XML content support on add list element
Issue-ID: CPS-2287
Change-Id: Ibb7ffb66ccbb03703266132c6d5c2eade0e7cb4a
Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
Diffstat (limited to 'cps-ncmp-service/src')
4 files changed, 6 insertions, 5 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceService.java index c71109013a..6b5ed908b8 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceService.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceService.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2024 Nordix Foundation + * Modifications Copyright (C) 2024 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -216,7 +217,7 @@ public class CmSubscriptionPersistenceService { cpsDataService.saveListElements(NCMP_DATASPACE_NAME, CM_SUBSCRIPTIONS_ANCHOR_NAME, CPS_PATH_QUERY_FOR_CM_SUBSCRIPTION_FILTERS_WITH_DATASTORE_AND_CMHANDLE.formatted( datastoreType.getDatastoreName(), cmHandleId), subscriptionDetailsAsJson, - OffsetDateTime.now()); + OffsetDateTime.now(), ContentType.JSON); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java index cd1237b884..0ca2cd3407 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java @@ -162,7 +162,7 @@ public class InventoryPersistenceImpl extends NcmpPersistenceImpl implements Inv Lists.partition(yangModelCmHandles, CMHANDLE_BATCH_SIZE)) { final String cmHandlesJsonData = createCmHandlesJsonData(yangModelCmHandleBatch); cpsDataService.saveListElements(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, - NCMP_DMI_REGISTRY_PARENT, cmHandlesJsonData, NO_TIMESTAMP); + NCMP_DMI_REGISTRY_PARENT, cmHandlesJsonData, NO_TIMESTAMP, ContentType.JSON); } } diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceServiceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceServiceSpec.groovy index 354e2af937..2b91065592 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceServiceSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/utils/CmSubscriptionPersistenceServiceSpec.groovy @@ -142,7 +142,7 @@ class CmSubscriptionPersistenceServiceSpec extends Specification { 'NCMP-Admin', 'cm-data-subscriptions', parentNodeXpath.formatted(datastoreName, 'ch-1'), - objectUnderTest.getSubscriptionDetailsAsJson('/x/y', ['newSubId']), _) + objectUnderTest.getSubscriptionDetailsAsJson('/x/y', ['newSubId']), _, ContentType.JSON) where: scenario | datastoreType || datastoreName 'passthrough_running' | PASSTHROUGH_RUNNING || 'ncmp-datastore:passthrough-running' diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy index e098fb81d7..e60bacbdc5 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy @@ -232,7 +232,7 @@ class InventoryPersistenceImplSpec extends Specification { objectUnderTest.saveCmHandle(yangModelCmHandle) then: 'the data service method to save list elements is called once' 1 * mockCpsDataService.saveListElements(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, NCMP_DMI_REGISTRY_PARENT, - _,null) >> { + _,null, ContentType.JSON) >> { args -> { assert args[3].startsWith('{"cm-handles":[{"id":"cmhandle","additional-properties":[],"public-properties":[]}]}') } @@ -247,7 +247,7 @@ class InventoryPersistenceImplSpec extends Specification { objectUnderTest.saveCmHandleBatch([yangModelCmHandle1, yangModelCmHandle2]) then: 'CPS Data Service persists both cm handles as a batch' 1 * mockCpsDataService.saveListElements(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, - NCMP_DMI_REGISTRY_PARENT, _,null) >> { + NCMP_DMI_REGISTRY_PARENT, _,null, ContentType.JSON) >> { args -> { def jsonData = (args[3] as String) jsonData.contains('cmhandle1') |