diff options
author | 2021-06-17 15:27:55 +0100 | |
---|---|---|
committer | 2021-06-18 15:14:12 +0100 | |
commit | 657a97124f0890f6bb5fec61a37978a6aa00a29d (patch) | |
tree | 2f41da96c24b071f6eef816c37c5f2305d38e8f9 /cps-service/src/test/groovy/org | |
parent | c6865f33336bcdcd79eb2659b1a7df130aee9452 (diff) |
Updating exception and explanation for update node leaves
Issue-ID: CPS-464 & CPS-465
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I1880ceee66d89c49d039011163fa74bb7da19f25
Diffstat (limited to 'cps-service/src/test/groovy/org')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy index 27a5a4e0c..8001d6a9f 100644 --- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy @@ -125,6 +125,19 @@ class CpsDataServiceImplSpec extends Specification { 'level 2 node' | '/test-tree' | '{"branch": [{"name":"Name"}]}' || '/test-tree/branch[@name=\'Name\']' | ['name': 'Name'] } + def 'Update list-element data node with : #scenario.'() { + given: 'schema set for given anchor and dataspace references bookstore model' + setupSchemaSetMocks('bookstore.yang') + when: 'update data method is invoked with json data #jsonData and parent node xpath' + objectUnderTest.updateNodeLeaves(dataspaceName, anchorName, '/bookstore/categories[@code=2]', jsonData) + then: 'the persistence service method is invoked with correct parameters' + thrown(DataValidationException) + where: 'following parameters were used' + scenario | jsonData + 'multiple leaves' | '{"code": "01","name": "some-name"}' + 'one leaf' | '{"name": "some-name"}' + } + def 'Replace data node: #scenario.'() { given: 'schema set for given anchor and dataspace references test-tree model' setupSchemaSetMocks('test-tree.yang') |