diff options
author | Arpit Singh <as00745003@techmahindra.com> | 2023-07-27 14:48:30 +0530 |
---|---|---|
committer | Arpit Singh <as00745003@techmahindra.com> | 2023-07-27 15:25:59 +0530 |
commit | 61f5e14c5cdebe659dfae0c7143a07d6f81cb06c (patch) | |
tree | a3c7d0f9b0b82c7bf295436ba9d3cd3242ea09c0 /integration-test/src/test/groovy/org/onap | |
parent | f1a506a235abe624704cfdd17aadbfe1760c4c04 (diff) |
Fix: Make bookstore data consistent
- Removed list named invoice from all bookstore files
- Added a new parent list as bookstore-address
- Refactored tests
Issue-ID: CPS-1813
Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
Change-Id: I5c7e83e1ee0ad9ac1d94d1906c2361c7a00d49af
Diffstat (limited to 'integration-test/src/test/groovy/org/onap')
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsDataServiceIntegrationSpec.groovy | 6 |
1 files changed, 3 insertions, 3 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 a3f14397c2..7c257adda6 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 @@ -183,15 +183,15 @@ class CpsDataServiceIntegrationSpec extends FunctionalSpecBase { def 'Add and Delete top-level list (element) data nodes with root node.'() { given: 'a new (multiple-data-tree:invoice) datanodes' - def json = '{"multiple-data-tree:invoice": [{"ProductID": "2","ProductName": "Mango","price": "150","stock": true}]}' + def json = '{"bookstore-address":[{"bookstore-name":"Scholastic","address":"Bangalore,India","postal-code":"560043"}]}' when: 'the new list elements are saved' objectUnderTest.saveListElements(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/', json, now) then: 'they can be retrieved by their xpaths' - objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/invoice[@ProductID ="2"]', INCLUDE_ALL_DESCENDANTS) + objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/bookstore-address[@bookstore-name="Easons"]', INCLUDE_ALL_DESCENDANTS) and: 'there is one extra datanode' assert originalCountBookstoreTopLevelListNodes + 1 == countTopLevelListDataNodesInBookstore() when: 'the new elements are deleted' - objectUnderTest.deleteDataNode(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/invoice[@ProductID ="2"]', now) + objectUnderTest.deleteDataNode(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/bookstore-address[@bookstore-name="Easons"]', now) then: 'the original number of datanodes is restored' assert originalCountBookstoreTopLevelListNodes == countTopLevelListDataNodesInBookstore() } |