diff options
author | 2023-04-24 09:08:29 +0000 | |
---|---|---|
committer | 2023-04-24 09:08:29 +0000 | |
commit | 2de9389a61f0feb37f0bcc22d6269e36dcfbd47c (patch) | |
tree | 4a711998055c4dc9060393d5318dcd3fe8679988 /integration-test/src | |
parent | 625707db447ddc390aae7652c353bbc6b88d9dfb (diff) | |
parent | dce6dfe44d952591780ef2a8b2375d4d1de5f5ba (diff) |
Merge "Use exact type for objectUnderTest in groovy tests"
Diffstat (limited to 'integration-test/src')
6 files changed, 13 insertions, 7 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAdminServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAdminServiceIntegrationSpec.groovy index a8ab5cab5..91a4c8ac0 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAdminServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAdminServiceIntegrationSpec.groovy @@ -20,6 +20,7 @@ package org.onap.cps.integration.functional +import org.onap.cps.api.CpsAdminService import org.onap.cps.integration.base.CpsIntegrationSpecBase import org.onap.cps.spi.exceptions.AlreadyDefinedException import org.onap.cps.spi.exceptions.AnchorNotFoundException @@ -27,7 +28,7 @@ import org.onap.cps.spi.exceptions.DataspaceNotFoundException class CpsAdminServiceIntegrationSpec extends CpsIntegrationSpecBase { - def objectUnderTest + CpsAdminService objectUnderTest def setup() { objectUnderTest = cpsAdminService } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy index 2c7c6ce35..7875caec3 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsAdminServiceLimits.groovy @@ -20,12 +20,13 @@ package org.onap.cps.integration.performance.cps +import org.onap.cps.api.CpsAdminService import org.onap.cps.integration.performance.base.CpsPerfTestBase import org.springframework.dao.DataAccessResourceFailureException class CpsAdminServiceLimits extends CpsPerfTestBase { - def objectUnderTest + CpsAdminService objectUnderTest def setup() { objectUnderTest = cpsAdminService } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy index 1cb4ed800..2df910194 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimits.groovy @@ -21,6 +21,7 @@ package org.onap.cps.integration.performance.cps import java.time.OffsetDateTime +import org.onap.cps.api.CpsDataService import org.onap.cps.integration.performance.base.CpsPerfTestBase import org.springframework.dao.DataAccessResourceFailureException import org.springframework.transaction.TransactionSystemException @@ -29,7 +30,7 @@ import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS class CpsDataServiceLimits extends CpsPerfTestBase { - def objectUnderTest + CpsDataService objectUnderTest def setup() { objectUnderTest = cpsDataService } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy index 4676c908b..c072755d3 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/GetPerfTest.groovy @@ -20,6 +20,7 @@ package org.onap.cps.integration.performance.cps +import org.onap.cps.api.CpsDataService import org.onap.cps.integration.performance.base.CpsPerfTestBase import static org.onap.cps.spi.FetchDescendantsOption.DIRECT_CHILDREN_ONLY @@ -28,7 +29,7 @@ import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS class GetPerfTest extends CpsPerfTestBase { - def objectUnderTest + CpsDataService objectUnderTest def setup() { objectUnderTest = cpsDataService } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy index 496842096..065365748 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy @@ -20,6 +20,7 @@ package org.onap.cps.integration.performance.cps +import org.onap.cps.api.CpsQueryService import org.onap.cps.integration.performance.base.CpsPerfTestBase import static org.onap.cps.spi.FetchDescendantsOption.DIRECT_CHILDREN_ONLY @@ -28,7 +29,7 @@ import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS class QueryPerfTest extends CpsPerfTestBase { - def objectUnderTest + CpsQueryService objectUnderTest def setup() { objectUnderTest = cpsQueryService } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy index 443dd7efd..5d7c9de51 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy @@ -21,13 +21,14 @@ package org.onap.cps.integration.performance.ncmp import java.util.stream.Collectors +import org.onap.cps.api.CpsQueryService import org.onap.cps.integration.performance.base.NcmpRegistryPerfTestBase import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS class CmHandleQueryPerfTest extends NcmpRegistryPerfTestBase { - def objectUnderTest + CpsQueryService objectUnderTest def setup() { objectUnderTest = cpsQueryService } @@ -35,7 +36,7 @@ class CmHandleQueryPerfTest extends NcmpRegistryPerfTestBase { when: 'a cps-path query on name-value pair is performed (without getting descendants)' stopWatch.start() def cpsPath = '//additional-properties[@name="neType" and @value="RadioNode"]/ancestor::cm-handles' - def dataNodes = cpsQueryService.queryDataNodes(NCMP_PERFORMANCE_TEST_DATASPACE, REGISTRY_ANCHOR, cpsPath, OMIT_DESCENDANTS) + def dataNodes = objectUnderTest.queryDataNodes(NCMP_PERFORMANCE_TEST_DATASPACE, REGISTRY_ANCHOR, cpsPath, OMIT_DESCENDANTS) and: 'the ids of the result are extracted and converted to xpath' def xpaths = dataNodes.stream().map(dataNode -> "/dmi-registry/cm-handles[@id='${dataNode.leaves.id}']".toString() ).collect(Collectors.toSet()) and: 'a single get is executed to get all the parent objects and their descendants' |