diff options
author | shivasubedi <shiva.subedi@est.tech> | 2021-04-29 12:48:05 +0100 |
---|---|---|
committer | Shiva Subedi <shiva.subedi@est.tech> | 2021-04-29 11:54:59 +0000 |
commit | 8a74ced574d566024513044859f433d263e3cc1b (patch) | |
tree | ded9f6e3ebffad554fc184ca231d4a0fa78e8c3f /cps-ri/src | |
parent | ff7ba3a74265b62b116abb2fc34767f87444a655 (diff) |
Investigate and update Spock version
Issue-ID: CPS-368
Signed-off-by: shivasubedi <shiva.subedi@est.tech>
Change-Id: Ie8505cf29068660af6bc6b9887f593f7e3be074f
Diffstat (limited to 'cps-ri/src')
5 files changed, 1 insertions, 30 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy index 0d75d3fed3..0f70adeecf 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy @@ -28,7 +28,6 @@ import org.onap.cps.spi.exceptions.SchemaSetNotFoundException import org.onap.cps.spi.model.Anchor import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.jdbc.Sql -import spock.lang.Unroll class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { @@ -72,7 +71,6 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { anchor.schemaSetName == SCHEMA_SET_NAME1 } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Create anchor error scenario: #scenario.'() { when: 'attempt to create new anchor named #anchorName in dataspace #dataspaceName with #schemaSetName' @@ -86,7 +84,6 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { 'anchor already exists' | DATASPACE_NAME | SCHEMA_SET_NAME1 | ANCHOR_NAME1 || AlreadyDefinedException } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Get anchor error scenario: #scenario.'() { when: 'attempt to get anchor named #anchorName in dataspace #dataspaceName' @@ -99,7 +96,6 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { 'anchor does not exists' | DATASPACE_NAME | 'unknown' || AnchorNotFoundException } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Get all anchors in dataspace #dataspaceName.'() { when: 'all anchors are retrieved from #DATASPACE_NAME' @@ -131,7 +127,6 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { assert fragmentRepository.findById(DELETED_FRAGMENT_ID).isEmpty() } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'delete anchor error scenario: #scenario'(){ when: 'delete anchor attempt is performed' diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy index 6a0a6f48ba..bfc088db2a 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy @@ -30,7 +30,6 @@ import org.onap.cps.spi.model.DataNode import org.onap.cps.spi.model.DataNodeBuilder import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.jdbc.Sql -import spock.lang.Unroll import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS @@ -78,7 +77,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query for single leaf value with type: #type.'() { when: 'a query is executed to get a data node by the given cps path' @@ -94,7 +92,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { 'Integer and descendants' | '/parent-200/child-202[@common-leaf-name-int=5]' | INCLUDE_ALL_DESCENDANTS || 1 } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Query for attribute by cps path with cps paths that return no data because of #scenario.'() { when: 'a query is executed to get datanodes for the given cps path' @@ -108,7 +105,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { 'incomplete end of xpath prefix' | '/parent-200/child-20[@common-leaf-name-int=5]' } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query using descendant anywhere and #type (further) descendants.'() { when: 'a query is executed to get a data node by the given cps path' @@ -123,7 +119,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { 'include' | INCLUDE_ALL_DESCENDANTS || 1 } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query using descendant anywhere with %scenario '() { when: 'a query is executed to get a data node by the given cps path' @@ -140,7 +135,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { 'descendant name match end of other node' | '//child-202' || ['/parent-200/child-202','/parent-201/child-202'] } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query using descendant anywhere ends with yang list containing %scenario '() { when: 'a query is executed to get a data node by the given cps path' @@ -159,7 +153,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { 'attributes reversed in order' | '//child-202[@common-leaf-name="common-leaf value" and @common-leaf-name-int=5]' || ['/parent-200/child-202'] } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query error scenario using descendant anywhere ends with yang list containing %scenario '() { when: 'a query is executed to get a data node by the given cps path' diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy index ea6b26923a..afd2cd1423 100755 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy @@ -34,7 +34,6 @@ import org.onap.cps.spi.model.DataNodeBuilder import org.springframework.beans.factory.annotation.Autowired import org.springframework.dao.DataIntegrityViolationException import org.springframework.test.context.jdbc.Sql -import spock.lang.Unroll import javax.validation.ConstraintViolationException @@ -107,7 +106,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { fragment2.xpath == xpath } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Store datanode error scenario: #scenario.'() { when: 'attempt to store a data node with #scenario' @@ -138,7 +136,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { parentFragment.getChildFragments().find({ it.xpath == newChild.xpath }) } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Add child error scenario: #scenario.'() { when: 'attempt to add a child data node with #scenario' @@ -167,7 +164,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { return fragmentRepository.findByDataspaceAndAnchorAndXpath(dataspace, anchor, xpath).orElseThrow() } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Get data node by xpath without descendants.'() { when: 'data node is requested' @@ -185,7 +181,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { 'empty xpath' |'' } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Get data node by xpath with all descendants.'() { when: 'data node is requested with all descendants' @@ -199,7 +194,7 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { assert mappedResult.get('/parent-100/child-002').getChildDataNodes().size() == 1 and: 'extracted leaves maps are matching expected' mappedResult.forEach( - (inputXPath, dataNode) -> assertLeavesMaps(dataNode.getLeaves(), expectedLeavesByXpathMap[inputXPath])) + (xPath, dataNode) -> assertLeavesMaps(dataNode.getLeaves(), expectedLeavesByXpathMap[xPath])) where: 'the following data is used' scenario | inputXPath 'some xpath' |'/parent-100' @@ -228,7 +223,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { return flatMap } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Get data node error scenario: #scenario.'() { when: 'attempt to get data node with #scenario' @@ -259,7 +253,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { assert childLeaves.'leaf-value' == 'original' } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Update data leaves error scenario: #scenario.'() { when: 'attempt to update data node for #scenario' @@ -312,7 +305,6 @@ class CpsDataPersistenceServiceSpec extends CpsPersistenceSpecBase { assert childLeaves.'leaf-value' == 'original' } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Replace data node tree error scenario: #scenario.'() { given: 'data node object' diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy index 441ddb65ff..f08aa03579 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy @@ -32,7 +32,6 @@ import org.onap.cps.spi.repository.AnchorRepository import org.onap.cps.spi.repository.SchemaSetRepository import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.jdbc.Sql -import spock.lang.Unroll class CpsModulePersistenceServiceSpec extends CpsPersistenceSpecBase { @@ -66,7 +65,6 @@ class CpsModulePersistenceServiceSpec extends CpsPersistenceSpecBase { dataspaceEntity = dataspaceRepository.getByName(DATASPACE_NAME) } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Store schema set error scenario: #scenario.'() { when: 'attempt to store schema set #schemaSetName in dataspace #dataspaceName' @@ -149,7 +147,6 @@ class CpsModulePersistenceServiceSpec extends CpsPersistenceSpecBase { sharedResourceIds.each {yangResourceRepository.findById(it).isPresent() } } - @Unroll @Sql([CLEAR_DATA, SET_DATA]) def 'Delete schema set error scenario: #scenario.'() { when: 'attempt to delete a schema set where #scenario' diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy index b3b205320c..bd0fb44feb 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy @@ -22,13 +22,11 @@ package org.onap.cps.spi.query import org.onap.cps.spi.exceptions.CpsPathException import spock.lang.Specification -import spock.lang.Unroll class CpsPathQuerySpec extends Specification { def objectUnderTest = new CpsPathQuery() - @Unroll def 'Parse cps path with valid cps path and a filter with #scenario.'() { when: 'the given cps path is parsed' def result = objectUnderTest.createFrom(cpsPath) @@ -46,7 +44,6 @@ class CpsPathQuerySpec extends Specification { 'key in top container' | '/parent[@common-leaf-name-int=5]' || '/parent' |'common-leaf-name-int' | 5 } - @Unroll def 'Parse cps path of type ends with a #scenario.'() { when: 'the given cps path is parsed' def result = objectUnderTest.createFrom(cpsPath) @@ -60,7 +57,6 @@ class CpsPathQuerySpec extends Specification { 'parent & child' | '//parent/child' || 'parent/child' } - @Unroll def 'Parse cps path that ends with a yang list containing #scenario.'() { when: 'the given cps path is parsed' def result = objectUnderTest.createFrom(cpsPath) @@ -75,7 +71,6 @@ class CpsPathQuerySpec extends Specification { 'more than one attribute' | '//child[@int-leaf=5 and @leaf-name="leaf value"]' || 2 } - @Unroll def 'Parse cps path with #scenario.'() { when: 'the given cps path is parsed' objectUnderTest.createFrom(cpsPath) @@ -93,7 +88,6 @@ class CpsPathQuerySpec extends Specification { 'missing attribute value' | '//child[@int-leaf=5 and @name]' } - @Unroll def 'Convert cps leaf value to valid type with leaf of type #scenario.'() { when: 'the given leaf value is converted' def result = objectUnderTest.convertLeafValueToCorrectType(leafValueInputString, 'source xPath (for error message only)') |