Ensure prefix is correct module prefix 91/131891/9
authorToineSiebelink <toine.siebelink@est.tech>
Thu, 27 Oct 2022 16:29:04 +0000 (17:29 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Wed, 2 Nov 2022 09:00:41 +0000 (09:00 +0000)
commit14e5bf958bb2b114e3e7d8876bd6f031900c79ec
treea72bcfee795ab6e27938e5e265327d6aace804e3
parenta096a7faa35b345c765102201a5a09cc03ef541a
Ensure prefix is correct module prefix

- Moved Prefix logic from RI to Service layer
- Prefix is no PREFIX propety, not the moduel name!
== RI (DB Layer) Changes
- Removed prefix logic incl hazelcast
- Added new basic ri-test for getDataNode and assert prefix is null
- Updated exsiting ri-test to us getDataNode
- Updated existing ri-test to only use " where really needed
== CPS Service Layer Changes
- Introduced PrefixResolver with clear and limited responsibility
- Use PrefixResolver where needed
- Cache prefix map per anchor, use cached entry when available
- Disabled SONAR on new Regex
== REST Layer
- Use PrefixResolver where needed

Issue-ID: CPS-1353
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Ie16f0e1ee1c280f3eb69c9e64fab69a780fb692a
26 files changed:
cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java
cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
cps-ri/pom.xml
cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsPersistenceSpecBase.groovy
cps-service/pom.xml
cps-service/src/main/java/org/onap/cps/cache/AnchorDataCacheConfig.java [moved from cps-ri/src/main/java/org/onap/cps/spi/cache/AnchorDataCacheConfig.java with 89% similarity]
cps-service/src/main/java/org/onap/cps/cache/AnchorDataCacheEntry.java [moved from cps-ri/src/main/java/org/onap/cps/spi/cache/AnchorDataCacheEntry.java with 88% similarity]
cps-service/src/main/java/org/onap/cps/notification/CpsDataUpdatedEventFactory.java
cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java
cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java
cps-service/src/main/java/org/onap/cps/utils/PrefixResolver.java [new file with mode: 0644]
cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy [moved from cps-ri/src/test/groovy/org/onap/cps/spi/cache/AnchorDataCacheConfigSpec.groovy with 93% similarity]
cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheEntrySpec.groovy [moved from cps-ri/src/test/groovy/org/onap/cps/spi/cache/AnchorDataCacheEntrySpec.groovy with 95% similarity]
cps-service/src/test/groovy/org/onap/cps/notification/CpsDataUpdateEventFactorySpec.groovy
cps-service/src/test/groovy/org/onap/cps/spi/model/DataNodeBuilderSpec.groovy
cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy
cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy [new file with mode: 0644]
cps-service/src/test/resources/test-tree.yang
csit/tests/cps-data/cps-data.robot