diff options
Diffstat (limited to 'cps-path-parser/src/test')
-rw-r--r-- | cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy index 153dfbe9ed..96fdf88cf6 100644 --- a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy +++ b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy @@ -136,6 +136,17 @@ class CpsPathQuerySpec extends Specification { 'descendant with leaf value and ancestor' | '//child[@other-leaf=1]/leaf-name[text()="search"]/ancestor::parent' || true | true } + def 'Parse #scenario cps path with contains function condition'() { + when: 'the given cps path is parsed' + def result = CpsPathQuery.createFrom('//someContainer[contains(@lang,"en")]') + then: 'the query has the right xpath type' + result.cpsPathPrefixType == DESCENDANT + and: 'the right contains function condition is set' + result.hasContainsFunctionCondition() + result.containsFunctionConditionLeafName == 'lang' + result.containsFunctionConditionValue == 'en' + } + def 'Parse cps path with error: #scenario.'() { when: 'the given cps path is parsed' CpsPathQuery.createFrom(cpsPath) |