From 7b6ab50231f5ab39d1476531031437f81328115e Mon Sep 17 00:00:00 2001 From: mpriyank Date: Tue, 6 Sep 2022 18:29:34 +0100 Subject: 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 --- .../src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cps-service/src/test/groovy') 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> assert listElementsCollection.size() == 1 -- cgit 1.2.3-korg