Fix "ends-with" query syntax to conform with xPath definition 63/120563/1
authorToineSiebelink <toine.siebelink@est.tech>
Thu, 15 Apr 2021 11:15:01 +0000 (12:15 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Thu, 15 Apr 2021 11:30:51 +0000 (12:30 +0100)
commitf92d32193545e0b2cd8f9124b01433678b813435
treeab578726eccc6690e08e5d0491d1d2ea365d7fad
parenta2d25b524c49d869cbd4479a807aaeb9313474a6
Fix "ends-with" query syntax to conform with xPath definition

"ends-with" is HOW we resolve it in sql query. 'descendant anywhere' is the correct Path name for the '//' operator
- Updated method names, variable names, test description to reflect the correct terminolgy
- Udpated query to always perfix the target (descendant name) with an '\' so it alwasy only matches whole node names
- Updated regex for cpsPath to NOT accept triple /// (as per xPath this is invalid since a ndoeName cannot start with or contain a node separator

Issue-ID: CPS-336

Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: I9f181d6986d038311b839e3f9c5afc4237c7d347
cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java
cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQueryType.java
cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy