Skip to content

Commit

Permalink
Missing test for getDataNodes (ep1)
Browse files Browse the repository at this point in the history
  - there was no test to check the exceptions thrown by getDataNodes

Signed-off-by: Arpit Singh <[email protected]>
Change-Id: Ifa1df8ebe83fafba833be14559d94261bca93ef0
  • Loading branch information
arpit-at-techm committed Aug 18, 2023
1 parent a52b182 commit 12c32ee
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12c32ee

Please sign in to comment.