summaryrefslogtreecommitdiffstats
path: root/integration-test/src
diff options
context:
space:
mode:
authorLuke Gleeson <luke.gleeson@est.tech>2023-08-22 08:49:37 +0000
committerGerrit Code Review <gerrit@onap.org>2023-08-22 08:49:37 +0000
commit916b63064c171efb9dae15326e40fc9d0dc49027 (patch)
treef39076f53516426ac1b33b5b5486dd2511c04d71 /integration-test/src
parentab3874879824cb52640d53f272ea7fe8bdb02038 (diff)
parent12c32eed67af26ef8a0c44a4b30a349d2fadeffe (diff)
Merge "Missing test for getDataNodes (ep1)"
Diffstat (limited to 'integration-test/src')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy14
1 files changed, 14 insertions, 0 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy
index 82a415ecef..2fe275383f 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy
@@ -102,6 +102,20 @@ class CpsDataServiceIntegrationSpec extends FunctionalSpecBase {
cpsPath << [ 'invalid path', '/non-existing-path' ]
}
+ def 'Get data nodes error scenario #scenario'() {
+ when: 'attempt to retrieve data nodes'
+ objectUnderTest.getDataNodes(dataspaceName, anchorName, xpath, OMIT_DESCENDANTS)
+ then: 'expected exception is thrown'
+ thrown(expectedException)
+ where: 'following data is used'
+ scenario | dataspaceName | anchorName | xpath || expectedException
+ 'non existent dataspace' | 'non-existent' | 'not-relevant' | '/not-relevant' || DataspaceNotFoundException
+ 'non existent anchor' | FUNCTIONAL_TEST_DATASPACE_1 | 'non-existent' | '/not-relevant' || AnchorNotFoundException
+ 'non-existent xpath' | FUNCTIONAL_TEST_DATASPACE_1 | BOOKSTORE_ANCHOR_1| '/non-existing' || DataNodeNotFoundException
+ 'invalid-dataspace' | 'Invalid dataspace' | 'not-relevant' | '/not-relevant' || DataValidationException
+ 'invalid-dataspace' | FUNCTIONAL_TEST_DATASPACE_1 | 'Invalid Anchor' | '/not-relevant' || DataValidationException
+ }
+
def 'Delete root data node.'() {
when: 'the "root" is deleted'
objectUnderTest.deleteDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, [ '/' ], now)