Fix bugs for Policy Executor requests: 95/142895/2
authorToineSiebelink <toine.siebelink@est.tech>
Thu, 8 Jan 2026 13:22:35 +0000 (13:22 +0000)
committerToineSiebelink <toine.siebelink@est.tech>
Fri, 9 Jan 2026 15:30:15 +0000 (15:30 +0000)
commit7acd1d6fca0dc838c426ac9ac70ffb089298ce53
tree69b3b9ba43aabf3bfdce78121419d9773a60c2fa
parenta9a35ef425b899ab6d700dc1f3af8055779188f7
Fix bugs for Policy Executor requests:

- applied naming convention, main ones:
  requestParameters.fdn() For fdn from URI and or extendedFdn in case of patch -operation
  (extended)path for anything that might have attributes
  only use terms "resourceIdentifier" and "targetIdentifier" JUST before calling Policy Execution method
- Ensure path for each patch operation is appended to target FDN
- DeleteOperationDetails is not needed, using blank default instead
- So only one type of OperationDetails required, so removed interface and renamed the only impl.
- Refactored code to correctly handle possible child paths in patchItems
- hardcoded attribute conversion to object for standard /attributes without #
- objectName in body for patch is optional, should be same as in URI, id should be same too. So we CAN ignore (no validation!)
- added convenience method for getting parent or targetFdn (when /attributes is used)
- added convenience method for removing trailing # (when #/attributes is used)
- renamed ParameterMapper to Helper as it is more generic now. Also made is static for easier access

TODO
- Check URL send to DMI (test!) when using (#)/attributes

Decisions Csaba K (to record in Wiki)
- (#)/attributes is NOT allowed in get or create or delete
- (#)/attributes is NOT compulsory for Patch.replace and Patch.uppate
- (#)/attributes should NOT be in URI to PolicyExecutor (targetIdentifier)

Issue-ID: CPS-2826
Change-Id: Icd1dbcd6033b79019d35d6cb68c1d6caee64fb01
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
18 files changed:
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/ProvMnSController.java
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/ProvMnSRestExceptionHandler.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/ProvMnSControllerSpec.groovy
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/CreateOperationDetails.java [deleted file]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/DeleteOperationDetails.java [deleted file]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/OperationDetails.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/OperationDetailsFactory.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/dmi/DmiRestClient.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/provmns/ParameterHelper.java [new file with mode: 0644]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/provmns/ParameterMapper.java [deleted file]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/provmns/ParametersBuilder.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/provmns/RequestParameters.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/policyexecutor/OperationDetailsFactorySpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/utils/DmiDataOperationsHelperSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/provmns/ParameterHelperSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/provmns/ParameterMapperSpec.groovy [deleted file]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/provmns/RequestParametersSpec.groovy [deleted file]
docker-compose/docker-compose.yml