Move ConditionProperties from CPS to NCMP 68/142568/4
authorshikha0203 <shivani.khare@est.tech>
Thu, 27 Nov 2025 10:32:33 +0000 (10:32 +0000)
committershikha0203 <shivani.khare@est.tech>
Wed, 3 Dec 2025 12:24:27 +0000 (12:24 +0000)
Issue-ID: CPS-2729
Change-Id: Iba04f16a000dd461165ab8db18bd71e168a64eb2
Signed-off-by: shikha0203 <shivani.khare@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/models/CmHandleQueryServiceParameters.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/models/ConditionProperties.java [moved from cps-service/src/main/java/org/onap/cps/api/model/ConditionProperties.java with 92% similarity]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/models/ConditionPropertiesSpec.groovy [moved from cps-service/src/test/groovy/org/onap/cps/api/model/ConditionPropertiesSpec.groovy with 92% similarity]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryParametersParameterMapperSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy

index c4e9eef..dc05d85 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022 Nordix Foundation
+ *  Copyright (C) 2022-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.
@@ -29,7 +29,6 @@ import java.util.List;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
-import org.onap.cps.api.model.ConditionProperties;
 
 @Setter
 @Getter
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022 Nordix Foundation
+ *  Copyright (C) 2022-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.api.model;
+package org.onap.cps.ncmp.api.inventory.models;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
index a34a89f..be9627c 100644 (file)
@@ -36,9 +36,9 @@ import java.util.Map;
 import java.util.function.BiFunction;
 import lombok.RequiredArgsConstructor;
 import org.onap.cps.api.exceptions.DataValidationException;
-import org.onap.cps.api.model.ConditionProperties;
 import org.onap.cps.cpspath.parser.PathParsingException;
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters;
+import org.onap.cps.ncmp.api.inventory.models.ConditionProperties;
 import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle;
 import org.onap.cps.ncmp.impl.inventory.models.PropertyType;
 import org.onap.cps.ncmp.impl.inventory.models.SouthboundCmHandleQuerySupportedConditions;
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation
+ *  Copyright (C) 2023-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.api.model
+package org.onap.cps.ncmp.api.inventory.models
 
 import com.fasterxml.jackson.databind.ObjectMapper
 import spock.lang.Specification
 
+
 class ConditionPropertiesSpec extends Specification {
 
     ObjectMapper objectMapper = new ObjectMapper()
index e2ce433..aa9a0d3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022 Nordix Foundation
+ *  Copyright (C) 2022-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.
@@ -20,9 +20,9 @@
 
 package org.onap.cps.ncmp.impl.inventory
 
-import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters
 import org.onap.cps.api.exceptions.DataValidationException
-import org.onap.cps.api.model.ConditionProperties
+import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters
+import org.onap.cps.ncmp.api.inventory.models.ConditionProperties
 import spock.lang.Specification
 
 class CmHandleQueryParametersParameterMapperSpec extends Specification {
@@ -41,8 +41,8 @@ class CmHandleQueryParametersParameterMapperSpec extends Specification {
             def cmHandleQueryParameters = new CmHandleQueryServiceParameters()
             def condition = new ConditionProperties()
             condition.conditionName = 'validConditionName'
-            condition.conditionParameters = [['key':'value']]
-        cmHandleQueryParameters.cmHandleQueryParameters = [condition]
+            condition.conditionParameters = [['key': 'value']]
+            cmHandleQueryParameters.cmHandleQueryParameters = [condition]
         when: 'validator is invoked'
             CmHandleQueryParametersValidator.validateCmHandleQueryParameters(cmHandleQueryParameters, ['validConditionName'])
         then: 'data validation exception is not thrown'
@@ -100,10 +100,10 @@ class CmHandleQueryParametersParameterMapperSpec extends Specification {
         and: 'exception message matches the expected message'
             e.details.contains(exceptionMessage)
         where:
-            scenario                              | conditionProperty                               || exceptionMessage
-            'more than one condition is supplied' | ['cpsPath':'some-path', 'cpsPath2':'some-path'] || 'Only one condition property is allowed for the CPS path query.'
-            'cpsPath key not supplied'            | ['wrong-key':'some-path']                       || 'Wrong CPS path condition property. - expecting "cpsPath" as the condition property.'
-            'cpsPath not supplied'                | ['cpsPath':'']                                  || 'Wrong CPS path. - please supply a valid CPS path.'
+            scenario                              | conditionProperty                                 || exceptionMessage
+            'more than one condition is supplied' | ['cpsPath': 'some-path', 'cpsPath2': 'some-path'] || 'Only one condition property is allowed for the CPS path query.'
+            'cpsPath key not supplied'            | ['wrong-key': 'some-path']                        || 'Wrong CPS path condition property. - expecting "cpsPath" as the condition property.'
+            'cpsPath not supplied'                | ['cpsPath': '']                                   || 'Wrong CPS path. - please supply a valid CPS path.'
     }
 
     def 'No conditions.'() {
@@ -113,7 +113,7 @@ class CmHandleQueryParametersParameterMapperSpec extends Specification {
 
     def 'Validate CmHandle where #scenario.'() {
         when: 'the validator is called on a cps path condition property'
-            def result = CmHandleQueryParametersValidator.validateCpsPathConditionProperties(['cpsPath':cpsPath])
+            def result = CmHandleQueryParametersValidator.validateCpsPathConditionProperties(['cpsPath': cpsPath])
         then: 'the expected boolean value is returned'
             result == expectedBoolean
         where:
index 75fed66..ec24eb5 100644 (file)
@@ -25,7 +25,6 @@ package org.onap.cps.ncmp.impl.inventory
 
 import com.fasterxml.jackson.databind.ObjectMapper
 import org.onap.cps.api.exceptions.DataValidationException
-import org.onap.cps.api.model.ConditionProperties
 import org.onap.cps.ncmp.api.exceptions.CmHandleNotFoundException
 import org.onap.cps.ncmp.api.inventory.DataStoreSyncState
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryApiParameters
@@ -33,6 +32,7 @@ import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters
 import org.onap.cps.ncmp.api.inventory.models.CmHandleState
 import org.onap.cps.ncmp.api.inventory.models.CompositeState
 import org.onap.cps.ncmp.api.inventory.models.ConditionApiProperties
+import org.onap.cps.ncmp.api.inventory.models.ConditionProperties
 import org.onap.cps.ncmp.api.inventory.models.DmiPluginRegistration
 import org.onap.cps.ncmp.api.inventory.models.LockReasonCategory
 import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle
index 1d69aab..b0100ca 100644 (file)
@@ -22,10 +22,10 @@ package org.onap.cps.ncmp.impl.inventory
 
 import org.onap.cps.api.exceptions.DataInUseException
 import org.onap.cps.api.exceptions.DataValidationException
-import org.onap.cps.api.model.ConditionProperties
 import org.onap.cps.api.model.DataNode
 import org.onap.cps.cpspath.parser.PathParsingException
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters
+import org.onap.cps.ncmp.api.inventory.models.ConditionProperties
 import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle
 import org.onap.cps.ncmp.impl.inventory.models.YangModelCmHandle
 import org.onap.cps.ncmp.impl.inventory.trustlevel.TrustLevelManager