summaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/test')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy8
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy5
2 files changed, 7 insertions, 6 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy
index c636f4b5ff..29085a9c7e 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/DataMapUtilsSpec.groovy
@@ -68,8 +68,8 @@ class DataMapUtilsSpec extends Specification {
scenario | xPath | expectedNodeIdentifier
'container xpath' | '/bookstore' | 'sampleModuleName:bookstore'
'xpath contains list attribute' | '/bookstore/categories[@code=1]' | 'sampleModuleName:categories'
- 'xpath contains list attributes with /' | '/bookstore/categories[@code=1/2]' | 'sampleModuleName:categories'
-
+ 'xpath contains list attributes with /' | '/bookstore/categories[@code="1/2"]' | 'sampleModuleName:categories'
+ 'xpath contains list attributes with [' | '/bookstore/categories[@code="[1]"]' | 'sampleModuleName:categories'
}
def 'Data node structure with anchor name conversion to map with root node identifier.'() {
@@ -98,7 +98,7 @@ class DataMapUtilsSpec extends Specification {
def dataNode = buildDataNode(
"/parent",[parentLeaf:'parentLeafValue', parentLeafList:['parentLeafListEntry1','parentLeafListEntry2']],[
- buildDataNode('/parent/child-list[@id=1/2]',[listElementLeaf:'listElement1leafValue'],noChildren),
+ buildDataNode('/parent/child-list[@id="1/2"]',[listElementLeaf:'listElement1leafValue'],noChildren),
buildDataNode('/parent/child-list[@id=2]',[listElementLeaf:'listElement2leafValue'],noChildren),
buildDataNode('/parent/child-object',[childLeaf:'childLeafValue'],
[buildDataNode('/parent/child-object/grand-child-object',[grandChildLeaf:'grandChildLeafValue'],noChildren)]
@@ -107,7 +107,7 @@ class DataMapUtilsSpec extends Specification {
def dataNodeWithAnchor = buildDataNodeWithAnchor(
"/parent", 'anchor01',[parentLeaf:'parentLeafValue', parentLeafList:['parentLeafListEntry1','parentLeafListEntry2']],[
- buildDataNode('/parent/child-list[@id=1/2]',[listElementLeaf:'listElement1leafValue'],noChildren),
+ buildDataNode('/parent/child-list[@id="1/2"]',[listElementLeaf:'listElement1leafValue'],noChildren),
buildDataNode('/parent/child-list[@id=2]',[listElementLeaf:'listElement2leafValue'],noChildren),
buildDataNode('/parent/child-object',[childLeaf:'childLeafValue'],
[buildDataNode('/parent/child-object/grand-child-object',[grandChildLeaf:'grandChildLeafValue'],noChildren)]
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy
index 4c1b891168..ff6ab346f2 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/PrefixResolverSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2021-2022 Bell Canada.
* ================================================================================
@@ -77,8 +77,9 @@ class PrefixResolverSpec extends Specification {
'/test-tree/with/descendants' || 'tree'
'/test-tree[@id=1]' || 'tree'
'/test-tree[@id=1]/child' || 'tree'
+ '/test-tree[@id="[1]"]/child' || 'tree'
+ '//test-tree' || ''
'/not-defined' || ''
- 'invalid-xpath' || ''
}
def 'get prefix with populated anchor data cache with #scenario cache entry'() {