X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=integration-test%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fintegration%2Fbase%2FCpsIntegrationSpecBase.groovy;h=6dec3dbf952cfc0b62173787d60dfcda51f93cd1;hb=a966bab93a17fcba4e7fc28354c01b3f0878fbbe;hp=40fe030184543f66f91cfff0f6d05c1a2c242458;hpb=597d4ef72e5388092cc80ae662af6711f735369f;p=cps.git diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy index 40fe03018..6dec3dbf9 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy @@ -20,10 +20,11 @@ package org.onap.cps.integration.base +import org.onap.cps.api.CpsAnchorService +import org.onap.cps.api.CpsDataService +import org.onap.cps.api.CpsDataspaceService +import org.onap.cps.api.CpsModuleService import org.onap.cps.api.CpsQueryService -import org.onap.cps.api.impl.CpsAdminServiceImpl -import org.onap.cps.api.impl.CpsDataServiceImpl -import org.onap.cps.api.impl.CpsModuleServiceImpl import org.onap.cps.integration.DatabaseTestContainer import org.onap.cps.spi.config.CpsSessionFactory import org.onap.cps.spi.exceptions.DataspaceNotFoundException @@ -44,7 +45,7 @@ import spock.lang.Specification import java.time.OffsetDateTime -@SpringBootTest(classes = [TestConfig, CpsAdminServiceImpl, CpsValidatorImpl, SessionManager, CpsSessionFactory]) +@SpringBootTest(classes = [TestConfig, CpsValidatorImpl, SessionManager, CpsSessionFactory]) @Testcontainers @EnableAutoConfiguration @EnableJpaRepositories(basePackageClasses = [DataspaceRepository]) @@ -57,15 +58,19 @@ class CpsIntegrationSpecBase extends Specification { @Autowired @Lazy - CpsAdminServiceImpl cpsAdminService + CpsDataspaceService cpsDataspaceService @Autowired @Lazy - CpsDataServiceImpl cpsDataService + CpsAnchorService cpsAnchorService @Autowired @Lazy - CpsModuleServiceImpl cpsModuleService + CpsDataService cpsDataService + + @Autowired + @Lazy + CpsModuleService cpsModuleService @Autowired @Lazy @@ -83,7 +88,7 @@ class CpsIntegrationSpecBase extends Specification { def setup() { if (!initialized) { - cpsAdminService.createDataspace(GENERAL_TEST_DATASPACE) + cpsDataspaceService.createDataspace(GENERAL_TEST_DATASPACE) def bookstoreModelFileContent = readResourceDataFile('bookstore/bookstore.yang') cpsModuleService.createSchemaSet(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, [bookstore : bookstoreModelFileContent]) initialized = true; @@ -108,7 +113,7 @@ class CpsIntegrationSpecBase extends Specification { def dataspaceExists(dataspaceName) { try { - cpsAdminService.getDataspace(dataspaceName) + cpsDataspaceService.getDataspace(dataspaceName) } catch (DataspaceNotFoundException dataspaceNotFoundException) { return false } @@ -117,7 +122,7 @@ class CpsIntegrationSpecBase extends Specification { def addAnchorsWithData(numberOfAnchors, dataspaceName, schemaSetName, anchorNamePrefix, data) { (1..numberOfAnchors).each { - cpsAdminService.createAnchor(dataspaceName, schemaSetName, anchorNamePrefix + it) + cpsAnchorService.createAnchor(dataspaceName, schemaSetName, anchorNamePrefix + it) cpsDataService.saveData(dataspaceName, anchorNamePrefix + it, data.replace("Easons", "Easons-"+it.toString()), OffsetDateTime.now()) } }