aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service/src/test/groovy
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2022-09-06 18:29:34 +0100
committermpriyank <priyank.maheshwari@est.tech>2022-09-12 18:09:43 +0100
commit7b6ab50231f5ab39d1476531031437f81328115e (patch)
tree3939da0046a69ab31d391e14bd2b5af699202baf /cps-service/src/test/groovy
parent440dc8aab179f6c8451683f53b019ccd8bd60bdf (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')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy2
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 ab960df6a..3f28f0ac8 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