Add dm-service-name cm-handle searches to integration tests 73/141373/1
authorToineSiebelink <toine.siebelink@est.tech>
Tue, 24 Jun 2025 15:50:01 +0000 (16:50 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Tue, 24 Jun 2025 16:21:28 +0000 (17:21 +0100)
- Split cm handle search tests in North- and Southbound test classes
- Added test variations with and without (additional) cm handle properties
- Too many functional NCMP test: grouped them in folder by feature names
  (semi-automatically updated copyright to all moved files even if not strictly necessary
- Reformatted and cleaned up (descriptions) northbound tests
- Minor reformatting of production code
- Increase margin on performance timer accuracy test (unrelated but caused test to fail sometimes)

Issue-ID:CPS-1872

Change-Id: I3bbf3b2b6b4301bbed0eb72d76ec7125e89f0217
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
19 files changed:
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/RestOutputCmHandleMapper.java
integration-test/src/test/groovy/org/onap/cps/integration/ResourceMeterAccuracyTest.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/cmnotificationsubscription/CmNotificationSubscriptionSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmNotificationSubscriptionSpec.groovy with 97% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/data/AlternateIdSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/AlternateIdSpec.groovy with 94% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/data/BearerTokenPassthroughSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/BearerTokenPassthroughSpec.groovy with 97% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/data/DmiUrlEncodingPassthroughSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DmiUrlEncodingPassthroughSpec.groovy with 92% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/data/LegacyBatchDataOperationSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/LegacyBatchDataOperationSpec.groovy with 99% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/datajobs/DataJobResultServiceSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobResultServiceSpec.groovy with 93% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/datajobs/DataJobStatusServiceSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobStatusServiceSpec.groovy with 94% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/datajobs/WriteSubJobSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/WriteSubJobSpec.groovy with 96% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleCreateSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleCreateSpec.groovy with 94% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleSearchesNorthBoundRestApiSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/RestApiSpec.groovy with 84% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleSearchesSouthBoundRestApiSpec.groovy [new file with mode: 0644]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleUpdateSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpdateSpec.groovy with 96% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleUpgradeSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/CmHandleUpgradeSpec.groovy with 98% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModuleSyncWatchdogIntegrationSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/ModuleSyncWatchdogIntegrationSpec.groovy with 98% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/ModulesRestApiSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/YangModulesSpec.groovy with 96% similarity]
integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/policyexecutor/PolicyExecutorIntegrationSpec.groovy [moved from integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/PolicyExecutorIntegrationSpec.groovy with 96% similarity]

index e8cc0b9..3a5102c 100644 (file)
@@ -95,8 +95,8 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
         final boolean includeCmHandlePropertiesParameter = Boolean.TRUE.equals(includeCmHandlePropertiesInQuery);
         final List<RestOutputCmHandle> restOutputCmHandles =
                 networkCmProxyInventoryFacade.executeCmHandleInventorySearch(cmHandleQueryApiParameters)
-                        .map(handle -> restOutputCmHandleMapper
-                                .toRestOutputCmHandle(handle, includeCmHandlePropertiesParameter))
+                        .map(ncmpServiceCmHandle -> restOutputCmHandleMapper
+                            .toRestOutputCmHandle(ncmpServiceCmHandle, includeCmHandlePropertiesParameter))
                         .collectList().block();
         return ResponseEntity.ok(restOutputCmHandles);
     }
index 32d8716..000d96f 100644 (file)
@@ -52,8 +52,7 @@ public class RestOutputCmHandleMapper {
             restOutputCmHandle.setCmHandleProperties(null);
         }
         restOutputCmHandle.setState(
-                cmHandleStateMapper.toCmHandleCompositeStateExternalLockReason(
-                        ncmpServiceCmHandle.getCompositeState()));
+            cmHandleStateMapper.toCmHandleCompositeStateExternalLockReason(ncmpServiceCmHandle.getCompositeState()));
         if (ncmpServiceCmHandle.getCurrentTrustLevel() != null) {
             restOutputCmHandle.setTrustLevel(ncmpServiceCmHandle.getCurrentTrustLevel().toString());
         }
index 0bb4720..f2ae325 100644 (file)
@@ -33,9 +33,9 @@ class ResourceMeterAccuracyTest extends Specification {
             objectUnderTest.start()
             TimeUnit.SECONDS.sleep(2)
             objectUnderTest.stop()
-        then: 'the resource meter reports a duration within 20ms of the expected duration'
-            assert objectUnderTest.getTotalTimeInSeconds() >= 1.98
-            assert objectUnderTest.getTotalTimeInSeconds() <= 2.02
+        then: 'the resource meter reports a duration within 40ms of the expected duration'
+            assert objectUnderTest.getTotalTimeInSeconds() >= 1.96
+            assert objectUnderTest.getTotalTimeInSeconds() <= 2.04
     }
 
 }
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.cmnotificationsubscription
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.onap.cps.ncmp.impl.cmnotificationsubscription.utils.CmSubscriptionPersistenceService
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.data
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.springframework.http.HttpStatus
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.data
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.springframework.http.HttpHeaders
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.data
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.springframework.http.MediaType
 
-import static org.springframework.http.HttpMethod.DELETE
 import static org.springframework.http.HttpMethod.GET
-import static org.springframework.http.HttpMethod.PATCH
 import static org.springframework.http.HttpMethod.POST
-import static org.springframework.http.HttpMethod.PUT
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.request
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
 
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.datajobs
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.onap.cps.ncmp.api.datajobs.DataJobResultService
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.datajobs
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.onap.cps.ncmp.api.datajobs.DataJobService
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import java.time.Duration
 import org.apache.kafka.clients.consumer.KafkaConsumer
@@ -157,11 +157,11 @@ class CmHandleCreateSpec extends CpsIntegrationSpecBase {
 
         when: 'a batch of CM-handles is registered for creation with various alternate IDs'
             def cmHandlesToCreate = [
-                    new NcmpServiceCmHandle(cmHandleId: 'ch-3', alternateId: NO_ALTERNATE_ID),
-                    new NcmpServiceCmHandle(cmHandleId: 'ch-4', alternateId: 'unique-alt-id'),
-                    new NcmpServiceCmHandle(cmHandleId: 'ch-5', alternateId: 'existing-alt-id'),
-                    new NcmpServiceCmHandle(cmHandleId: 'ch-6', alternateId: 'duplicate-alt-id'),
-                    new NcmpServiceCmHandle(cmHandleId: 'ch-7', alternateId: 'duplicate-alt-id'),
+                new NcmpServiceCmHandle(cmHandleId: 'ch-3', alternateId: NO_ALTERNATE_ID),
+                new NcmpServiceCmHandle(cmHandleId: 'ch-4', alternateId: 'unique-alt-id'),
+                new NcmpServiceCmHandle(cmHandleId: 'ch-5', alternateId: 'existing-alt-id'),
+                new NcmpServiceCmHandle(cmHandleId: 'ch-6', alternateId: 'duplicate-alt-id'),
+                new NcmpServiceCmHandle(cmHandleId: 'ch-7', alternateId: 'duplicate-alt-id'),
             ]
             def dmiPluginRegistration = new DmiPluginRegistration(dmiPlugin: DMI1_URL, createdCmHandles: cmHandlesToCreate)
             def dmiPluginRegistrationResponse = objectUnderTest.updateDmiRegistration(dmiPluginRegistration)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import static org.hamcrest.Matchers.containsInAnyOrder
 import static org.hamcrest.Matchers.hasSize
@@ -30,19 +30,18 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.springframework.http.MediaType
 
-class RestApiSpec extends CpsIntegrationSpecBase {
+class CmHandleSearchesNorthBoundRestApiSpec extends CpsIntegrationSpecBase {
 
-    def 'Register CM Handles using REST API.'() {
+    def 'Register CM Handles using REST API (setup).'() {
         given: 'DMI will return modules'
             dmiDispatcher1.moduleNamesPerCmHandleId = [
                 'ch-1': ['M1', 'M2'],
                 'ch-2': ['M1', 'M2'],
                 'ch-3': ['M1', 'M3']
             ]
-        when: 'a POST request is made to register the CM Handles'
+        when: 'register the CM Handles'
             def requestBody = '{"dmiPlugin":"'+DMI1_URL+'","createdCmHandles":[{"cmHandle":"ch-1","alternateId":"alt-1"},{"cmHandle":"ch-2","alternateId":"alt-2"},{"cmHandle":"ch-3","alternateId":"alt-3"}]}'
-            mvc.perform(post('/ncmpInventory/v1/ch').contentType(MediaType.APPLICATION_JSON).content(requestBody))
-                    .andExpect(status().is2xxSuccessful())
+            mvc.perform(post('/ncmpInventory/v1/ch').contentType(MediaType.APPLICATION_JSON).content(requestBody)).andExpect(status().is2xxSuccessful())
         and: 'the module sync watchdog is triggered'
             moduleSyncWatchdog.moduleSyncAdvisedCmHandles()
         then: 'CM-handles go to READY state'
@@ -56,19 +55,17 @@ class RestApiSpec extends CpsIntegrationSpecBase {
     def 'Search for CM Handles by module using REST API.'() {
         given: 'a JSON request body containing search parameter'
             def requestBodyWithModuleCondition = """{
-                    "cmHandleQueryParameters": [
-                            {
+                    "cmHandleQueryParameters": [ {
                                 "conditionName": "hasAllModules",
                                 "conditionParameters": [ {"moduleName": "%s"} ]
-                            }
-                    ]
+                            } ]
                 }""".formatted(moduleName)
-        expect: "a search for module ${moduleName} returns expected CM handles"
+        expect: 'a search for module #moduleName returns expected CM handles'
             mvc.perform(post('/ncmp/v1/ch/id-searches'+outputAlternateId).contentType(MediaType.APPLICATION_JSON).content(requestBodyWithModuleCondition))
                     .andExpect(status().is2xxSuccessful())
                     .andExpect(jsonPath('$[*]', containsInAnyOrder(expectedCmHandleReferences.toArray())))
                     .andExpect(jsonPath('$', hasSize(expectedCmHandleReferences.size())));
-        where:
+        where: 'the following parameters are used'
             moduleName | outputAlternateId           || expectedCmHandleReferences
             'M1'       | '?outputAlternateId=false'  || ['ch-1', 'ch-2', 'ch-3']
             'M2'       | '?outputAlternateId=false'  || ['ch-1', 'ch-2']
@@ -77,36 +74,33 @@ class RestApiSpec extends CpsIntegrationSpecBase {
             'M2'       | '?outputAlternateId=true'   || ['alt-1', 'alt-2']
             'M3'       | '?outputAlternateId=true'   || ['alt-3']
             'M1'       | ''                          || ['ch-1', 'ch-2', 'ch-3']
-
     }
 
     def 'Search for CM Handles using Cps Path Query.'() {
         given: 'a JSON request body containing search parameter'
             def requestBodyWithSearchCondition = """{
-                    "cmHandleQueryParameters": [
-                            {
+                    "cmHandleQueryParameters": [ {
                                 "conditionName": "cmHandleWithCpsPath",
                                 "conditionParameters": [ {"cpsPath" : "%s"} ]
-                            }
-                    ]
+                            } ]
                 }""".formatted(cpsPath)
-        expect: "a search for cps path ${cpsPath} returns expected CM handles"
+        expect: 'a search for cps path #cpsPath returns expected CM handles'
             mvc.perform(post('/ncmp/v1/ch/id-searches').contentType(MediaType.APPLICATION_JSON).content(requestBodyWithSearchCondition))
                     .andExpect(status().is2xxSuccessful())
                     .andExpect(jsonPath('$[*]', containsInAnyOrder(expectedCmHandles.toArray())))
                     .andExpect(jsonPath('$', hasSize(expectedCmHandles.size())));
-        where:
+        where: 'the following parameters are used'
             scenario                    | cpsPath                                 || expectedCmHandles
             'All Ready CM handles'      | "//state[@cm-handle-state='READY']"     || ['ch-1', 'ch-2', 'ch-3']
             'Having Alternate ID alt-3' | "//cm-handles[@alternate-id='alt-3']"   || ['ch-3']
     }
 
     def 'De-register CM handles using REST API.'() {
-        when: 'a POST request is made to deregister the CM Handle'
+        when: 'deregister the CM Handles'
             def requestBody = '{"dmiPlugin":"'+DMI1_URL+'", "removedCmHandles": ["ch-1", "ch-2", "ch-3"]}'
             mvc.perform(post('/ncmpInventory/v1/ch').contentType(MediaType.APPLICATION_JSON).content(requestBody))
                     .andExpect(status().is2xxSuccessful())
-        then: 'the CM handles are not found using GET'
+        then: 'the CM handles are gone'
             (1..3).each {
                 mvc.perform(get('/ncmp/v1/ch/ch-'+it)).andExpect(status().is4xxClientError())
             }
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleSearchesSouthBoundRestApiSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/inventory/CmHandleSearchesSouthBoundRestApiSpec.groovy
new file mode 100644 (file)
index 0000000..b4154d2
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ *  ============LICENSE_START=======================================================
+ *  Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the 'License');
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an 'AS IS' BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.integration.functional.ncmp.inventory
+
+import org.onap.cps.integration.base.CpsIntegrationSpecBase
+import org.springframework.http.MediaType
+
+import static org.hamcrest.Matchers.containsInAnyOrder
+import static org.hamcrest.Matchers.hasSize
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
+
+class CmHandleSearchesSouthBoundRestApiSpec extends CpsIntegrationSpecBase {
+
+    def 'Search for CM Handles by dmi-service using REST API.'() {
+        given: 'register some CM Handles for dmi service #DMI1_URL (has to be done in same test otherwise URL/Port changes)'
+            def requestBody = '{"dmiPlugin":"'+DMI1_URL+'","createdCmHandles":[{"cmHandle":"ch-1"},{"cmHandle":"ch-2"}]}'
+            mvc.perform(post('/ncmpInventory/v1/ch').contentType(MediaType.APPLICATION_JSON).content(requestBody)).andExpect(status().is2xxSuccessful())
+        and: 'a cm-handle search on dmi service name request (body)'
+            def dmiPluginNameSearchValue = useCorrectDmiForSearch ? DMI1_URL : 'non existing dmi'
+            def requestBodyWithModuleCondition = """{
+                    "cmHandleQueryParameters": [ {
+                                "conditionName": "cmHandleWithDmiPlugin",
+                                "conditionParameters": [ {"dmiPluginName": "%s"} ]
+                            } ]
+                }""".formatted(dmiPluginNameSearchValue)
+        when: 'the search is executed it returns expected CM handles'
+            def result = mvc.perform(post("/ncmpInventory/v1/ch/searchCmHandles?includeCmHandlePropertiesInQuery=${includeCmHandleProperties}").contentType(MediaType.APPLICATION_JSON).content(requestBodyWithModuleCondition))
+                    .andExpect(status().is2xxSuccessful())
+                    .andExpect(jsonPath('$', hasSize(expectedCmHandleReferences.size())))
+                    .andExpect(jsonPath('$[*].cmHandle', containsInAnyOrder(expectedCmHandleReferences.toArray())))
+                    .andReturn()
+        then: 'the result response only contains additional properties when requested'
+            assert result.response.contentAsString.contains('cmHandleProperties') == includeCmHandleProperties
+        cleanup: 'deregister the CM Handles'
+            requestBody = '{"dmiPlugin":"'+DMI1_URL+'", "removedCmHandles": ["ch-1", "ch-2"]}'
+            mvc.perform(post('/ncmpInventory/v1/ch').contentType(MediaType.APPLICATION_JSON).content(requestBody)).andExpect(status().is2xxSuccessful())
+        where: 'the following parameters are used'
+            useCorrectDmiForSearch | includeCmHandleProperties || expectedCmHandleReferences
+            true                   | true                      || ['ch-1', 'ch-2']
+            true                   | false                     || ['ch-1', 'ch-2']
+            false                  | false                     || []
+    }
+
+}
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.onap.cps.ncmp.api.NcmpResponseStatus
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 import org.onap.cps.ncmp.api.inventory.models.CmHandleRegistrationResponse
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024-2025 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import com.hazelcast.map.IMap
 import io.micrometer.core.instrument.MeterRegistry
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.inventory
 
 import org.onap.cps.integration.base.CpsIntegrationSpecBase
 
@@ -33,7 +33,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
 
-class YangModulesSpec extends CpsIntegrationSpecBase {
+class ModulesRestApiSpec extends CpsIntegrationSpecBase {
 
     def setup() {
         dmiDispatcher1.moduleNamesPerCmHandleId['ch-1'] = ['M1', 'M2']
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2024 Nordix Foundation
+ *  Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
  *  you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  *  ============LICENSE_END=========================================================
  */
 
-package org.onap.cps.integration.functional.ncmp
+package org.onap.cps.integration.functional.ncmp.policyexecutor
 
 import com.fasterxml.jackson.databind.ObjectMapper
 import org.onap.cps.integration.base.CpsIntegrationSpecBase