Improve CPS Exception handling 30/116230/5
authorToineSiebelink <toine.siebelink@est.tech>
Tue, 8 Dec 2020 12:08:31 +0000 (12:08 +0000)
committerToineSiebelink <toine.siebelink@est.tech>
Thu, 10 Dec 2020 10:11:53 +0000 (10:11 +0000)
commit098a93c84aae8d8d74e7589518a576b84c38ca27
tree97ef75d4be28415dbc71d093db1d8d27d6ac3f4c
parent9647834359b168ed8091cecaecd363cb87abe874
Improve CPS Exception handling

- Removing unnecessary level of CPS(Validation)Exception
- Moved exception inside spi package
- Rename exceptions are per agreed new exception hierarchy
- Use new exceptions
- Added SchemaSetAlreadDefined Exception
- Added AnchorAlreadyDefined Exception
- Ensure unique serialVersionUIDs
- Fixed CpsAdmin(Persistence)ServiceImplSpec tests (there was a mix-up about what this class was testing)
- Replaced exception builder with dedicated exception (constructors)

Issue-ID: CPS-8

Change-Id: I9cb80af4951e69ee7b0e99303853955de9d4399f
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
22 files changed:
cps-rest/src/main/java/org/onap/cps/rest/controller/CpsRestController.java
cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java
cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/spi/repository/DataspaceRepository.java
cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleRepository.java
cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java
cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java
cps-service/src/main/java/org/onap/cps/api/impl/CpsModuleServiceImpl.java
cps-service/src/main/java/org/onap/cps/exceptions/CpsExceptionBuilder.java [deleted file]
cps-service/src/main/java/org/onap/cps/spi/exceptions/AnchorAlreadyDefinedException.java [new file with mode: 0644]
cps-service/src/main/java/org/onap/cps/spi/exceptions/CpsAdminException.java [moved from cps-service/src/main/java/org/onap/cps/exceptions/CpsAdminException.java with 73% similarity]
cps-service/src/main/java/org/onap/cps/spi/exceptions/CpsException.java [moved from cps-service/src/main/java/org/onap/cps/exceptions/CpsException.java with 75% similarity]
cps-service/src/main/java/org/onap/cps/spi/exceptions/DataValidationException.java [moved from cps-service/src/main/java/org/onap/cps/exceptions/CpsNotFoundException.java with 54% similarity]
cps-service/src/main/java/org/onap/cps/spi/exceptions/DataspaceNotFoundException.java [moved from cps-service/src/main/java/org/onap/cps/exceptions/DataspaceNotFoundException.java with 65% similarity]
cps-service/src/main/java/org/onap/cps/spi/exceptions/ModelValidationException.java [moved from cps-service/src/main/java/org/onap/cps/exceptions/CpsValidationException.java with 59% similarity]
cps-service/src/main/java/org/onap/cps/spi/exceptions/NotFoundInDataspaceException.java [new file with mode: 0644]
cps-service/src/main/java/org/onap/cps/spi/exceptions/SchemaSetAlreadyDefinedException.java [new file with mode: 0644]
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminPersistenceServiceImplSpec.groovy [deleted file]
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy [new file with mode: 0644]
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModulePersistenceServiceImplSpec.groovy