diff options
author | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2024-11-29 10:28:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-11-29 10:28:06 +0000 |
commit | a27a62c1ca4f87d126cb5e40cc797aed9aa590db (patch) | |
tree | 3fdcba0ecc089065040ed54db84d12b9586dcfef /integration-test | |
parent | b97d522cb3d08b596241aea88aafe3bd08b4ef77 (diff) | |
parent | dfcc95236daf7d45687fa42446a7d236ac12637e (diff) |
Merge "XML content support on Replace list content"
Diffstat (limited to 'integration-test')
2 files changed, 6 insertions, 6 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy index d49931eb7e..6c68a37f81 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy @@ -310,9 +310,9 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { def 'Attempt to add empty lists.'() { when: 'the batches of new list element(s) are saved' - objectUnderTest.replaceListContent(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/bookstore', [ ], now) - then: 'an admin exception is thrown' - thrown(CpsAdminException) + objectUnderTest.replaceListContent(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1 , '/bookstore', [ ] as String, now, ContentType.JSON) + then: 'an data exception is thrown' + thrown(DataValidationException) } def 'Add child error scenario: #scenario.'() { @@ -344,7 +344,7 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { assert countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore/categories[@code="2"]', DIRECT_CHILDREN_ONLY)) > 1 when: 'the categories list is replaced with just category "1" and without child nodes (books)' def json = '{"categories": [ {"code":"' +categoryCode + '"' + childJson + '} ] }' - objectUnderTest.replaceListContent(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore', json, now) + objectUnderTest.replaceListContent(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore', json, now, ContentType.JSON) then: 'the new replaced category can be retrieved but has no children anymore' assert expectedNumberOfDataNodes == countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore/categories[@code="' +categoryCode + '"]', DIRECT_CHILDREN_ONLY)) when: 'attempt to retrieve a category (code) not in the new list' diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy index 03abdb4b3f..d764029f02 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy @@ -94,7 +94,7 @@ class UpdatePerfTest extends CpsPerfTestBase { def jsonListData = generateJsonForOpenRoadmDevices(startId, totalNodes, changeLeaves) when: 'the container node is updated' resourceMeter.start() - objectUnderTest.replaceListContent(CPS_PERFORMANCE_TEST_DATASPACE, UPDATE_TEST_ANCHOR, '/openroadm-devices', jsonListData, now) + objectUnderTest.replaceListContent(CPS_PERFORMANCE_TEST_DATASPACE, UPDATE_TEST_ANCHOR, '/openroadm-devices', jsonListData, now, ContentType.JSON) resourceMeter.stop() then: 'there are the expected number of total nodes' assert totalNodes == countDataNodes('/openroadm-devices/openroadm-device') @@ -118,7 +118,7 @@ class UpdatePerfTest extends CpsPerfTestBase { def 'Update leaves for 100 data nodes.'() { given: 'there are 200 existing data nodes' def jsonListData = generateJsonForOpenRoadmDevices(1, 200, false) - objectUnderTest.replaceListContent(CPS_PERFORMANCE_TEST_DATASPACE, UPDATE_TEST_ANCHOR, '/openroadm-devices', jsonListData, now) + objectUnderTest.replaceListContent(CPS_PERFORMANCE_TEST_DATASPACE, UPDATE_TEST_ANCHOR, '/openroadm-devices', jsonListData, now, ContentType.JSON) and: 'JSON for updated data leaves of 100 nodes' def jsonDataUpdated = "{'openroadm-device':[" + (1..100).collect {"{'device-id':'C201-7-1A-" + it + "','status':'fail','ne-state':'jeopardy'}" }.join(",") + "]}" when: 'update is performed for leaves' |