From: egernug Date: Wed, 17 Dec 2025 12:36:40 +0000 (+0000) Subject: Add dmi-properties to integration test X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c4dd086398b275e1bed0d5156f759d96859b54be;p=cps.git Add dmi-properties to integration test Issue-ID: CPS-3061 Change-Id: I1dbf82bf6674875242f640f36caeedfcb7668764 Signed-off-by: egernug --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/DataMigrationIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/DataMigrationIntegrationSpec.groovy index 07d3b44450..8b31db68d0 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/DataMigrationIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/DataMigrationIntegrationSpec.groovy @@ -23,6 +23,7 @@ package org.onap.cps.integration.functional.ncmp.inventory import org.onap.cps.integration.base.CpsIntegrationSpecBase import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle import org.onap.cps.ncmp.init.DataMigration +import org.onap.cps.utils.ContentType import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.TestPropertySource @@ -38,9 +39,13 @@ class DataMigrationIntegrationSpec extends CpsIntegrationSpecBase { and: 'multiple CM handles registered, (top level) status is null' (1..2).each { registerCmHandle(DMI1_URL, 'ch-'+it, NO_MODULE_SET_TAG) + cpsDataService.saveListElements('NCMP-Admin', 'ncmp-dmi-registry', "/dmi-registry/cm-handles[@id='ch-${it}']", + '{"additional-properties":[{"name":"prop1","value":"value1"}]}', now, ContentType.JSON) def someCmHandle = networkCmProxyInventoryFacade.getNcmpServiceCmHandle('ch-'+it) assert someCmHandle.getCmHandleStatus() == null assert someCmHandle.getCompositeState().getCmHandleState().name() == 'READY' + assert someCmHandle.getDmiProperties() == null + assert someCmHandle.getAdditionalProperties() == ['prop1':'value1'] } when: 'migration is executed' objectUnderTest.migrateInventoryToModelRelease20250722(1) @@ -50,6 +55,8 @@ class DataMigrationIntegrationSpec extends CpsIntegrationSpecBase { def someCmHandle = networkCmProxyInventoryFacade.getNcmpServiceCmHandle('ch-'+it) assert someCmHandle.getCmHandleStatus() == 'READY' assert someCmHandle.getCompositeState().getCmHandleState().name() == 'READY' + assert someCmHandle.getDmiProperties() == '{"prop1":"value1"}' + assert someCmHandle.getAdditionalProperties() == ['prop1':'value1'] } cleanup: 'deregister CM handles' deregisterCmHandles(DMI1_URL, (1..2).collect{ 'ch-'+it })