Fix handling of special characters in prefix names
[cps.git] / cps-service / src / test / groovy / org / onap / cps / utils / PrefixResolverSpec.groovy
index 4c1b891..ff6ab34 100644 (file)
@@ -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'() {