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 /cps-service/src/test/groovy/org | |
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 'cps-service/src/test/groovy/org')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy | 4 |
1 files changed, 2 insertions, 2 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 ba438496fd..9d241f1bde 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 @@ -114,7 +114,7 @@ class CpsDataServiceImplSpec extends Specification { given: 'schema set for given anchor and dataspace references bookstore model' setupSchemaSetMocks('bookstore.yang') when: 'save data method is invoked with list element json data' - def jsonData = '{"multiple-data-tree:invoice": [{"ProductID": "2","ProductName": "Banana","price": "100","stock": True}]}' + def jsonData = '{"bookstore-address":[{"bookstore-name":"Easons","address":"Dublin,Ireland","postal-code":"D02HA21"}]}' objectUnderTest.saveListElements(dataspaceName, anchorName, '/', jsonData, observedTimestamp) then: 'the persistence service method is invoked with correct parameters' 1 * mockCpsDataPersistenceService.storeDataNodes(dataspaceName, anchorName, @@ -122,7 +122,7 @@ class CpsDataServiceImplSpec extends Specification { { assert dataNodeCollection.size() == 1 assert dataNodeCollection.collect { it.getXpath() } - .containsAll(['/invoice[@ProductID=\'2\']']) + .containsAll(['/bookstore-address[@bookstore-name=\'Easons\']']) } } ) |