X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=integration-test%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fintegration%2Fbase%2FFunctionalSpecBase.groovy;h=f18a8e4c97d8b783a727cf5ce70f20b73bc83358;hb=e626c9661fd88a585b50dafab5f5542784690143;hp=5e5269114e456b9fdc9ebf38f1ca9f25a0bdb536;hpb=1469741d2922cc1c28270cd52a31ad4cb3caa037;p=cps.git diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy index 5e5269114..f18a8e4c9 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy @@ -20,10 +20,15 @@ package org.onap.cps.integration.base -import java.time.OffsetDateTime - class FunctionalSpecBase extends CpsIntegrationSpecBase { + def static FUNCTIONAL_TEST_DATASPACE_1 = 'functionalTestDataspace1' + def static FUNCTIONAL_TEST_DATASPACE_2 = 'functionalTestDataspace2' + def static NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA = 2 + def static BOOKSTORE_ANCHOR_1 = 'bookstoreAnchor1' + def static BOOKSTORE_ANCHOR_2 = 'bookstoreAnchor2' + def static BOOKSTORE_ANCHOR_FOR_PATCH = 'bookstoreAnchor2' + def static initialized = false def setup() { @@ -35,15 +40,17 @@ class FunctionalSpecBase extends CpsIntegrationSpecBase { } def setupBookstoreInfraStructure() { - cpsAdminService.createDataspace(FUNCTIONAL_TEST_DATASPACE) + cpsAdminService.createDataspace(FUNCTIONAL_TEST_DATASPACE_1) + cpsAdminService.createDataspace(FUNCTIONAL_TEST_DATASPACE_2) def bookstoreYangModelAsString = readResourceDataFile('bookstore/bookstore.yang') - cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString]) - cpsAdminService.createAnchor(FUNCTIONAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, BOOKSTORE_ANCHOR) + cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString]) + cpsModuleService.createSchemaSet(FUNCTIONAL_TEST_DATASPACE_2, BOOKSTORE_SCHEMA_SET, [bookstore: bookstoreYangModelAsString]) } def addBookstoreData() { def bookstoreJsonData = readResourceDataFile('bookstore/bookstoreData.json') - cpsDataService.saveData(FUNCTIONAL_TEST_DATASPACE, BOOKSTORE_ANCHOR, bookstoreJsonData, OffsetDateTime.now()) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA, FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA, FUNCTIONAL_TEST_DATASPACE_2, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData) } }