diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2022-09-06 18:29:34 +0100 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2022-09-12 18:09:43 +0100 |
commit | 7b6ab50231f5ab39d1476531031437f81328115e (patch) | |
tree | 3939da0046a69ab31d391e14bd2b5af699202baf /cps-service/src/test/groovy/org/onap | |
parent | 440dc8aab179f6c8451683f53b019ccd8bd60bdf (diff) |
Handle partial failure
- Removing the transaction boundaries as it was getting rollbacked on
partial failures
- Handled adding the elements in batch and if it fails try them
individually
- Refactored code a bit and when there is partial failure we try one
more time in sequence and even if there are failures we collect the
failures
Issue-ID: CPS-1232
Issue-ID: CPS-1126
Change-Id: I7824c9f37f80cbaeedd5dc06d598ca0e3a69c59b
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-service/src/test/groovy/org/onap')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy | 2 |
1 files changed, 1 insertions, 1 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 ab960df6aa..3f28f0ac8d 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 @@ -143,7 +143,7 @@ class CpsDataServiceImplSpec extends Specification { def jsonData = '{"branch": [{"name": "A"}, {"name": "B"}]}' objectUnderTest.saveListElementsBatch(dataspaceName, anchorName, '/test-tree', [jsonData], observedTimestamp) then: 'the persistence service method is invoked with correct parameters' - 1 * mockCpsDataPersistenceService.addListElementsBatch(dataspaceName, anchorName, '/test-tree',_) >> { + 1 * mockCpsDataPersistenceService.addMultipleLists(dataspaceName, anchorName, '/test-tree',_) >> { args -> { def listElementsCollection = args[3] as Collection<Collection<DataNode>> assert listElementsCollection.size() == 1 |