Simplify Code around building DMI URLs 94/138094/4
authorToineSiebelink <toine.siebelink@est.tech>
Mon, 27 May 2024 14:02:35 +0000 (15:02 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Wed, 29 May 2024 16:27:26 +0000 (17:27 +0100)
commit7cb64300ddd10a9e9f0270a8c4832263e20d8ad3
treeab1d6ae63220aa1c1c76e2c9f0e7bae75100cb5e
parentc97bed8797bf9f16a019d8fdf25e2191b6854136
Simplify Code around building DMI URLs

- Bug analysis showed some unclear and complicated code for building URLs
- This patch is to clean up the related code and show more clearly what is encoded and what is not
- Use SPringBoot provided builder to apply correct encoding of all URI parts
- DmiOperations base class no longer need as no common code model and data operations anymore
- Converted builder to POJO (client needs to provide the only dmi properties upon build)
- Added some missing test (in affected code) to increase coverage percntage
(as the production code has significantly reduced in size the overal coverage was inadvertently reduced below the treshold)
- Added more unit test. Now impl.operations' package has 100%
- removed the test fro Dmi Exception that was incorrectly callign the handleException methdod directly instead of mocking an exception
it was really a dupclicate of a test I added but I was able to re-use the event checkign in my test

Issue-ID: CPS-2246
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: I1ff196cd03bbb95f5877ee590c321febeb672800
14 files changed:
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiModelOperations.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiOperations.java [deleted file]
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/OperationType.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/DmiPropertiesSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DatastoreTypeSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiModelOperationsSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiOperationsBaseSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/OperationTypeSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilderSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/EventDateTimeFormatterSpec.groovy [new file with mode: 0644]
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/RestQueryParametersValidatorSpec.groovy