Add method to get YANG module sources for CM handle
[cps.git] / cps-service / src / test / groovy / org / onap / cps / api / impl / CpsModuleServiceImplSpec.groovy
index 95d7314..429de7d 100644 (file)
@@ -24,7 +24,6 @@ package org.onap.cps.api.impl
 
 import org.onap.cps.TestUtils
 import org.onap.cps.api.CpsAdminService
-import org.onap.cps.spi.CascadeDeleteAllowed
 import org.onap.cps.spi.CpsModulePersistenceService
 import org.onap.cps.spi.exceptions.DataValidationException
 import org.onap.cps.spi.exceptions.ModelValidationException
@@ -243,4 +242,11 @@ class CpsModuleServiceImplSpec extends Specification {
         then: 'cps module persistence service is called with module references to check'
             1 * mockCpsModulePersistenceService.identifyNewModuleReferences(moduleReferencesToCheck);
     }
+
+    def 'Getting module definitions.'() {
+        when: 'get module definitions method is called with a valid dataspace and anchor name'
+            objectUnderTest.getModuleDefinitionsByAnchorName('some-dataspace-name', 'some-anchor-name')
+        then: 'CPS module persistence service is invoked the correct number of times'
+            1 * mockCpsModulePersistenceService.getYangResourceDefinitions('some-dataspace-name', 'some-anchor-name')
+    }
 }