From 46a7718bc0f0d2951ed18795c85f6961f839df25 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Tue, 10 Nov 2020 16:32:50 +0000 Subject: Xpath builder on data fragmentation Issue-ID: CPS-72 Change-Id: Iab5be2bf0dd7d5540b8880bbf5ab2c6ed9342a9e Signed-off-by: Ruslan Kashapov --- cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cps-service/src/test') diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy index 6a463ad6f5..801e43079a 100644 --- a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy @@ -96,6 +96,10 @@ class YangUtilsSpec extends Specification{ result.childFragments.size() == 2 and: 'each child (category) has the root fragment (result) as parent and in turn as 1 child (a list of books)' result.childFragments.each { it.parentFragment == result && it.childFragments.size() == 1 } + and: 'the fragments have the correct xpaths' + assert result.xpath == '/bookstore' + assert result.childFragments.collect { it.xpath } + .containsAll(["/bookstore/categories[@code='01']", "/bookstore/categories[@code='02']"]) } } -- cgit 1.2.3-korg