aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service/src/test')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy16
1 files changed, 16 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
index 7ffec1ab0..76f10de83 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/InventoryPersistenceSpec.groovy
@@ -202,6 +202,22 @@ class InventoryPersistenceSpec extends Specification {
}
}
+ def 'Save Multiple Cmhandles'() {
+ given: 'cm handles represented as Yang Model'
+ def yangModelCmHandle1 = new YangModelCmHandle(id: 'cmhandle1')
+ def yangModelCmHandle2 = new YangModelCmHandle(id: 'cmhandle2')
+ when: 'the cm handles are saved'
+ objectUnderTest.saveCmHandleBatch([yangModelCmHandle1, yangModelCmHandle2])
+ then: 'CPS Data Service persists both cm handles as a batch'
+ 1 * mockCpsDataService.saveListElementsBatch('NCMP-Admin','ncmp-dmi-registry','/dmi-registry',_,null) >> {
+ args -> {
+ def jsonDataList = (args[3] as List)
+ (jsonDataList[0] as String).contains('cmhandle1')
+ (jsonDataList[0] as String).contains('cmhandle2')
+ }
+ }
+ }
+
def 'Delete list or list elements'() {
when: 'the method to delete list or list elements is called'
objectUnderTest.deleteListOrListElement('sample xPath')