Merge "DMI Data AVC to use kafka headers"
[cps.git] / cps-service / src / test / groovy / org / onap / cps / api / impl / E2ENetworkSliceSpec.groovy
index ccfb23b..75f2974 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * ============LICENSE_START=======================================================\r
- * Copyright (C) 2021-2022 Nordix Foundation.\r
+ * Copyright (C) 2021-2023 Nordix Foundation.\r
  * Modifications Copyright (C) 2021-2022 Bell Canada.\r
  * Modifications Copyright (C) 2021 Pantheon.tech\r
  * Modifications Copyright (C) 2022 TechMahindra Ltd.\r
@@ -30,7 +30,9 @@ import org.onap.cps.spi.CpsDataPersistenceService
 import org.onap.cps.spi.CpsModulePersistenceService\r
 import org.onap.cps.spi.model.Anchor\r
 import org.onap.cps.spi.utils.CpsValidator\r
+import org.onap.cps.utils.TimedYangParser\r
 import org.onap.cps.utils.YangUtils\r
+import org.onap.cps.yang.TimedYangTextSchemaSourceSetBuilder\r
 import org.onap.cps.yang.YangTextSchemaSourceSetBuilder\r
 import spock.lang.Specification\r
 \r
@@ -41,10 +43,14 @@ class E2ENetworkSliceSpec extends Specification {
     def mockNotificationService = Mock(NotificationService)\r
     def mockYangTextSchemaSourceSetCache = Mock(YangTextSchemaSourceSetCache)\r
     def mockCpsValidator = Mock(CpsValidator)\r
+    def timedYangTextSchemaSourceSetBuilder = new TimedYangTextSchemaSourceSetBuilder()\r
+    def timedYangParser = new TimedYangParser()\r
+\r
     def cpsModuleServiceImpl = new CpsModuleServiceImpl(mockModuleStoreService,\r
-            mockYangTextSchemaSourceSetCache, mockCpsAdminService, mockCpsValidator)\r
+            mockYangTextSchemaSourceSetCache, mockCpsAdminService, mockCpsValidator,timedYangTextSchemaSourceSetBuilder)\r
+\r
     def cpsDataServiceImpl = new CpsDataServiceImpl(mockDataStoreService, mockCpsAdminService,\r
-            mockYangTextSchemaSourceSetCache, mockNotificationService, mockCpsValidator)\r
+            mockYangTextSchemaSourceSetCache, mockNotificationService, mockCpsValidator, timedYangParser)\r
 \r
     def dataspaceName = 'someDataspace'\r
     def anchorName = 'someAnchor'\r
@@ -84,7 +90,7 @@ class E2ENetworkSliceSpec extends Specification {
             def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-Cavsta-Data.txt')\r
         and : 'all the further dependencies are mocked '\r
             mockCpsAdminService.getAnchor(dataspaceName, anchorName) >>\r
-                    new Anchor().builder().name(anchorName).schemaSetName(schemaSetName).build()\r
+                    new Anchor().builder().name(anchorName).schemaSetName(schemaSetName).dataspaceName(dataspaceName).build()\r
             mockYangTextSchemaSourceSetCache.get(dataspaceName, schemaSetName) >>\r
                     YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap)\r
             mockModuleStoreService.getYangSchemaResources(dataspaceName, schemaSetName) >> schemaContext\r
@@ -117,7 +123,7 @@ class E2ENetworkSliceSpec extends Specification {
             def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-ran-inventory-data.json')\r
         and : 'all the further dependencies are mocked '\r
             mockCpsAdminService.getAnchor('someDataspace', 'someAnchor') >>\r
-                    new Anchor().builder().name('someAnchor').schemaSetName('someSchemaSet').build()\r
+                    new Anchor().builder().name('someAnchor').schemaSetName('someSchemaSet').dataspaceName(dataspaceName).build()\r
             mockYangTextSchemaSourceSetCache.get('someDataspace', 'someSchemaSet') >> YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap)\r
             mockModuleStoreService.getYangSchemaResources('someDataspace', 'someSchemaSet') >> schemaContext\r
         when: 'saveData method is invoked'\r