Merge "CmHandle delete is failing with InternalServerError: Null key is not allowed...
[cps.git] / integration-test / src / test / groovy / org / onap / cps / integration / base / FunctionalSpecBase.groovy
index b101945..b3b5842 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation
+ *  Copyright (C) 2023-2024 Nordix Foundation
  *  Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
@@ -53,11 +53,9 @@ class FunctionalSpecBase extends CpsIntegrationSpecBase {
         cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_1)
         cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_2)
         cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_3)
-        def bookstoreYangModelAsString = readResourceDataFile('bookstore/bookstore.yang')
-        cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString])
-        cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE_2, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString])
-        cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString])
-
+        createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_1)
+        createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_2)
+        createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_3)
     }
 
     def addBookstoreData() {
@@ -75,7 +73,7 @@ class FunctionalSpecBase extends CpsIntegrationSpecBase {
         def anchorName = 'bookstoreAnchor' + anchorNumber
         cpsAnchorService.deleteAnchor(FUNCTIONAL_TEST_DATASPACE_1, anchorName)
         cpsAnchorService.createAnchor(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, anchorName)
-        cpsDataService.saveData(FUNCTIONAL_TEST_DATASPACE_1, anchorName, bookstoreJsonData.replace("Easons", "Easons-"+anchorNumber.toString()), OffsetDateTime.now())
+        cpsDataService.saveData(FUNCTIONAL_TEST_DATASPACE_1, anchorName, bookstoreJsonData.replace('Easons', 'Easons-'+anchorNumber.toString()), OffsetDateTime.now())
     }
 
 }