Refactor ProvMnS error handling and simplify request parameters 83/142783/3
authorToineSiebelink <toine.siebelink@est.tech>
Thu, 11 Dec 2025 16:10:20 +0000 (16:10 +0000)
committerToineSiebelink <toine.siebelink@est.tech>
Tue, 23 Dec 2025 16:54:03 +0000 (16:54 +0000)
commit92c5d8ae3448e046dd132b35811cf3ef8b5325d3
treeabfe40210a501474ea06735eb0f461d6c8647429
parent11fbd0e1e72f0f36454b2444cb7ba9ef536e8d38
Refactor ProvMnS error handling and simplify request parameters

This update covers several tickets: CPS-3078, CPS-3093, CPS-3095, CPS-3096, CPS-3099
- Consolidate error handling in ProvMnSRestExceptionHandler
  - changed reason to title
- Remove ErrorResponseBuilder and integrate functionality into exception handler
- Refactor ProvMnsController and centralize error handling into 1 common method. including
  - correct code for Policy Executor denial
  - handle timeouts
  - handle all other exceptions
  - handle #/attribute reference validation depending on content type
- Enhance ProvMnSException with additional error handling capabilities
  use ProvMnSException to store the information to create the correct error response
- Simplify OperationDetailsFactory implementation

TODO: Remove docker config updates for debugging
TODO Lee Anjella
   - Check if a mapping to type is available for every possible statuscode in provMnsExceptions
   - COVREAGE 100% MIsine exception in ParameterMapper.java

Issue-ID: CPS-3093
Change-Id: Ic5ed5a8502ebf74166c73c037884979f468cdb8d
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
20 files changed:
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/ProvMnSController.java [new file with mode: 0644]
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/ProvMnSRestExceptionHandler.java [new file with mode: 0644]
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/ProvMnsController.java [deleted file]
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/provmns/ErrorResponseBuilder.java [deleted file]
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandlerSpec.groovy
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/ProvMnSControllerSpec.groovy [new file with mode: 0644]
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/ProvMnsControllerSpec.groovy [deleted file]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/exceptions/ProvMnSException.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/provmns/ParameterMapper.java
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 [moved from cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/provmns/RequestPathParameters.java with 85% similarity]
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/provmns/ParameterMapperSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/provmns/ParametersBuilderSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/provmns/RequestParametersSpec.groovy [new file with mode: 0644]
cps-parent/pom.xml
docker-compose/config/nginx/nginx.conf
docker-compose/docker-compose.yml