Investigate and update Spock version 04/121004/2
authorshivasubedi <shiva.subedi@est.tech>
Thu, 29 Apr 2021 11:48:05 +0000 (12:48 +0100)
committerShiva Subedi <shiva.subedi@est.tech>
Thu, 29 Apr 2021 11:54:59 +0000 (11:54 +0000)
Issue-ID: CPS-368
Signed-off-by: shivasubedi <shiva.subedi@est.tech>
Change-Id: Ie8505cf29068660af6bc6b9887f593f7e3be074f

20 files changed:
cps-dependencies/pom.xml
cps-ncmp-rest/pom.xml
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
cps-rest/pom.xml
cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy
cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy
cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy
cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy

index 63f8615..73aa36a 100755 (executable)
@@ -16,7 +16,7 @@
         <cglib-nodep.version>3.1</cglib-nodep.version>
         <commons-codec.version>1.15</commons-codec.version>
         <commons-lang3.version>3.11</commons-lang3.version>
-        <groovy.version>3.0.6</groovy.version>
+        <groovy.version>3.0.8</groovy.version>
         <hibernate-types.version>2.10.0</hibernate-types.version>
         <liquibase.version>4.3.1</liquibase.version>
         <nexusproxy>https://nexus.onap.org</nexusproxy>
@@ -24,8 +24,8 @@
         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
         <modelmapper.version>2.3.8</modelmapper.version>
         <sonar.skip>true</sonar.skip>
-        <spock-core.version>2.0-M2-groovy-3.0</spock-core.version>
-        <spock-spring.version>1.3-groovy-2.5</spock-spring.version>
+        <spock-core.version>2.0-M5-groovy-3.0</spock-core.version>
+        <spock-spring.version>2.0-M5-groovy-3.0</spock-spring.version>
         <spotbugs.version>4.2.0</spotbugs.version>
         <springboot.version>2.3.8.RELEASE</springboot.version>
         <springboot.cloud.version>Hoxton.SR9</springboot.cloud.version>
                 <artifactId>groovy</artifactId>
                 <version>${groovy.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.codehaus.groovy</groupId>
+                <artifactId>groovy-json</artifactId>
+                <version>${groovy.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.spockframework</groupId>
                 <artifactId>spock-core</artifactId>
index 9f0e132..02a7898 100644 (file)
         <artifactId>groovy</artifactId>
         <scope>test</scope>
     </dependency>
+    <dependency>
+        <groupId>org.codehaus.groovy</groupId>
+        <artifactId>groovy-json</artifactId>
+        <scope>test</scope>
+    </dependency>
     <dependency>
         <groupId>org.spockframework</groupId>
         <artifactId>spock-core</artifactId>
index f0a3d09..ea3c16d 100644 (file)
@@ -39,7 +39,6 @@ import org.springframework.http.HttpStatus
 import org.springframework.http.MediaType
 import org.springframework.test.web.servlet.MockMvc
 import spock.lang.Specification
-import spock.lang.Unroll
 
 @WebMvcTest
 class NetworkCmProxyControllerSpec extends Specification {
@@ -62,7 +61,6 @@ class NetworkCmProxyControllerSpec extends Specification {
     def cmHandle = 'some handle'
     def xpath = 'some xpath'
 
-    @Unroll
     def 'Query data node by cps path for the given cm handle with #scenario.'() {
         given: 'service method returns a list containing a data node'
             def dataNode = new DataNodeBuilder().withXpath('/xpath').build()
@@ -86,7 +84,6 @@ class NetworkCmProxyControllerSpec extends Specification {
             'descendants'               | 'true'                   || INCLUDE_ALL_DESCENDANTS
     }
 
-    @Unroll
     def 'Create data node: #scenario.'() {
         given: 'json data'
             def jsonData = 'json data'
index 95493bf..0a00e34 100644 (file)
@@ -25,7 +25,6 @@ import org.onap.cps.api.CpsQueryService
 import org.onap.cps.ncmp.api.impl.NetworkCmProxyDataServiceImpl
 import org.onap.cps.spi.FetchDescendantsOption
 import spock.lang.Specification
-import spock.lang.Unroll
 
 class NetworkCmProxyDataServiceImplSpec extends Specification {
     def objectUnderTest = new NetworkCmProxyDataServiceImpl()
@@ -51,7 +50,6 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
             fetchDescendantsOption << FetchDescendantsOption.values()
     }
 
-    @Unroll
     def 'Create full data node: #scenario.'() {
         given: 'a cm handle and root xpath'
             def jsonData = 'some json'
index ce304f3..1e535c4 100755 (executable)
             <artifactId>groovy</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy-json</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.spockframework</groupId>
             <artifactId>spock-core</artifactId>
index 1ccd3ba..e158ebd 100755 (executable)
@@ -47,7 +47,6 @@ import org.springframework.test.web.servlet.MockMvc
 import org.springframework.util.LinkedMultiValueMap
 import org.springframework.util.MultiValueMap
 import spock.lang.Specification
-import spock.lang.Unroll
 
 @WebMvcTest
 class AdminRestControllerSpec extends Specification {
@@ -171,7 +170,6 @@ class AdminRestControllerSpec extends Specification {
             response.status == HttpStatus.CREATED.value()
     }
 
-    @Unroll
     def 'Create schema set from zip archive having #caseDescriptor.'() {
         given: 'an endpoint'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
@@ -206,7 +204,6 @@ class AdminRestControllerSpec extends Specification {
             response.status == HttpStatus.BAD_REQUEST.value()
     }
 
-    @Unroll
     def 'Create schema set from #fileType file with IOException occurrence on processing.'() {
         given: 'an endpoint'
             def schemaSetEndpoint = "$basePath/v1/dataspaces/$dataspaceName/schema-sets"
index b7337e0..b64b561 100755 (executable)
@@ -48,7 +48,6 @@ import org.springframework.http.MediaType
 import org.springframework.test.web.servlet.MockMvc
 import spock.lang.Shared
 import spock.lang.Specification
-import spock.lang.Unroll
 
 @WebMvcTest
 class DataRestControllerSpec extends Specification {
@@ -90,7 +89,6 @@ class DataRestControllerSpec extends Specification {
         dataNodeBaseEndpoint = "$basePath/v1/dataspaces/$dataspaceName"
     }
 
-    @Unroll
     def 'Create a node: #scenario.'() {
         given: 'some json to create a data node'
             def endpoint = "$dataNodeBaseEndpoint/anchors/$anchorName/nodes"
@@ -133,7 +131,6 @@ class DataRestControllerSpec extends Specification {
             1 * mockCpsDataService.saveData(dataspaceName, anchorName, parentNodeXpath, json)
     }
 
-    @Unroll
     def 'Get data node with leaves'() {
         given: 'the service returns data node leaves'
             def xpath = 'some xPath'
@@ -151,7 +148,6 @@ class DataRestControllerSpec extends Specification {
             response.contentAsString.contains('"leafList":["leaveListElement1","leaveListElement2"]')
     }
 
-    @Unroll
     def 'Get data node with #scenario.'() {
         given: 'the service returns data node with #scenario'
             def xpath = 'some xPath'
@@ -174,8 +170,7 @@ class DataRestControllerSpec extends Specification {
             'no descendant explicitly'  | dataNodeWithLeavesNoChildren | 'false'                  || OMIT_DESCENDANTS             | false
             'with descendants'          | dataNodeWithChild            | 'true'                   || INCLUDE_ALL_DESCENDANTS      | true
     }
-    
-    @Unroll
+
     def 'Update data node leaves: #scenario.'() {
         given: 'json data'
             def jsonData = 'json data'
@@ -199,7 +194,6 @@ class DataRestControllerSpec extends Specification {
             'some xpath by parent' | '/some/xpath' || '/some/xpath'
     }
 
-    @Unroll
     def 'Replace data node tree: #scenario.'() {
         given: 'json data'
             def jsonData = 'json data'
index f3f1417..e42c75c 100644 (file)
@@ -38,7 +38,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
 import org.springframework.http.HttpStatus
 import org.springframework.test.web.servlet.MockMvc
 import spock.lang.Specification
-import spock.lang.Unroll
 
 @WebMvcTest
 class QueryRestControllerSpec extends Specification {
@@ -64,7 +63,6 @@ class QueryRestControllerSpec extends Specification {
     @Value('${rest.api.cps-base-path}')
     def basePath
 
-    @Unroll
     def 'Query data node by cps path for the given dataspace and anchor with #scenario.'() {
         given: 'service method returns a list containing a data node'
             def dataNode = new DataNodeBuilder().withXpath('/xpath').build()
index 30d5b62..6c14dde 100644 (file)
@@ -48,7 +48,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
 import org.springframework.test.web.servlet.MockMvc
 import spock.lang.Shared
 import spock.lang.Specification
-import spock.lang.Unroll
 
 @WebMvcTest
 class CpsRestExceptionHandlerSpec extends Specification {
@@ -121,7 +120,6 @@ class CpsRestExceptionHandlerSpec extends Specification {
                     "Anchor with name ${existingObjectName} already exists for ${dataspaceName}.")
     }
 
-    @Unroll
     def 'Get request with a #exceptionThrown.class.simpleName returns HTTP Status Bad Request'() {
         when: 'CPS validation exception is thrown by the service'
             setupTestException(exceptionThrown)
@@ -134,7 +132,6 @@ class CpsRestExceptionHandlerSpec extends Specification {
                                 new CpsPathException(errorMessage, errorDetails)]
     }
 
-    @Unroll
     def 'Delete request with a #exceptionThrown.class.simpleName returns HTTP Status Conflict'() {
         when: 'CPS validation exception is thrown by the service'
             setupTestException(exceptionThrown)
index 2c3d46e..3f4729e 100644 (file)
@@ -26,7 +26,6 @@ import org.onap.cps.utils.DataMapUtils
 import org.springframework.mock.web.MockMultipartFile
 import org.springframework.web.multipart.MultipartFile
 import spock.lang.Specification
-import spock.lang.Unroll
 
 class MultipartFileUtilSpec extends Specification {
 
@@ -61,7 +60,6 @@ class MultipartFileUtilSpec extends Specification {
             assert result["component.yang"] == "fake component content 1\n"
     }
 
-    @Unroll
     def 'Extract resources from zip archive having #caseDescriptor.'() {
         when: 'attempt to extract resources from zip file is performed'
             MultipartFileUtil.extractYangResourcesMap(multipartFile)
@@ -82,7 +80,6 @@ class MultipartFileUtilSpec extends Specification {
             thrown(ModelValidationException)
     }
 
-    @Unroll
     def 'IOException thrown during yang resources extraction from #fileType file.'() {
         when: 'attempt to extract resources from the file is performed'
             MultipartFileUtil.extractYangResourcesMap(multipartFileForIOException(fileType))
index 0d75d3f..0f70ade 100644 (file)
@@ -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'
index 6a0a6f4..bfc088d 100644 (file)
@@ -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'
index ea6b269..afd2cd1 100755 (executable)
@@ -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'
index 441ddb6..f08aa03 100644 (file)
@@ -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'
index b3b2053..bd0fb44 100644 (file)
@@ -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)')
index 29a2314..8fbf745 100644 (file)
@@ -30,7 +30,6 @@ import org.onap.cps.spi.model.DataNodeBuilder
 import org.onap.cps.yang.YangTextSchemaSourceSet
 import org.onap.cps.yang.YangTextSchemaSourceSetBuilder
 import spock.lang.Specification
-import spock.lang.Unroll
 
 class CpsDataServiceImplSpec extends Specification {
     def mockCpsDataPersistenceService = Mock(CpsDataPersistenceService)
@@ -89,7 +88,6 @@ class CpsDataServiceImplSpec extends Specification {
                     { dataNode -> dataNode.xpath == '/test-tree/branch[@name=\'New\']' })
     }
 
-    @Unroll
     def 'Get data node with option #fetchDescendantsOption.'() {
         def xpath = '/xpath'
         def dataNode = new DataNodeBuilder().withXpath(xpath).build()
@@ -101,7 +99,6 @@ class CpsDataServiceImplSpec extends Specification {
             fetchDescendantsOption << FetchDescendantsOption.values()
     }
 
-    @Unroll
     def 'Update data node leaves: #scenario.'() {
         given: 'that the admin service will return an anchor'
             def anchor = Anchor.builder().name(anchorName).schemaSetName(schemaSetName).build()
@@ -123,7 +120,6 @@ class CpsDataServiceImplSpec extends Specification {
             'level 2 node'   | '/test-tree'    | '{"branch": [{"name":"Name"}]}'  | '/test-tree/branch[@name=\'Name\']' | ['name': 'Name']
     }
 
-    @Unroll
     def 'Replace data node: #scenario.'() {
         given: 'that the admin service will return an anchor'
             def anchor = Anchor.builder().name(anchorName).schemaSetName(schemaSetName).build()
index 261d174..d20149b 100644 (file)
@@ -34,7 +34,6 @@ import org.springframework.cache.caffeine.CaffeineCacheManager
 import org.springframework.context.annotation.ComponentScan
 import org.springframework.test.context.ContextConfiguration
 import spock.lang.Specification
-import spock.lang.Unroll
 
 import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_ALLOWED
 import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED
@@ -95,7 +94,6 @@ class CpsModuleServiceImplSpec extends Specification {
             1 * mockModuleStoreService.getYangSchemaResources('someDataspace', 'someSchemaSet') >> yangResourcesNameToContentMap
     }
 
-    @Unroll
     def 'Delete set by name and dataspace with #cascadeDeleteOption.'() {
         when: 'schema set deletion is requested'
             objectUnderTest.deleteSchemaSet(dataspaceName, schemaSetname, cascadeDeleteOption)
index 99d25ec..3094515 100644 (file)
@@ -22,8 +22,6 @@ package org.onap.cps.api.impl
 import org.onap.cps.spi.CpsDataPersistenceService
 import org.onap.cps.spi.FetchDescendantsOption
 import spock.lang.Specification
-import spock.lang.Unroll
-
 
 class CpsQueryServiceImplSpec extends Specification {
     def mockCpsDataPersistenceService = Mock(CpsDataPersistenceService)
@@ -34,7 +32,6 @@ class CpsQueryServiceImplSpec extends Specification {
         objectUnderTest.cpsDataPersistenceService = mockCpsDataPersistenceService
     }
 
-    @Unroll
     def 'Query data nodes by cps path with #fetchDescendantsOption.'() {
         given: 'a dataspace name, an anchor name and a cps path'
             def dataspaceName = 'some dataspace'
index f7efd5d..e58f442 100644 (file)
@@ -24,11 +24,9 @@ import org.onap.cps.spi.exceptions.ModelValidationException
 import org.onap.cps.yang.YangTextSchemaSourceSetBuilder
 import org.opendaylight.yangtools.yang.common.Revision
 import spock.lang.Specification
-import spock.lang.Unroll
 
 class YangTextSchemaSourceSetSpec extends Specification {
 
-    @Unroll
     def 'Building a valid YangTextSchemaSourceSet using #filenameCase filename.'() {
         given: 'a yang model (file)'
             def yangResourceNameToContent = [filename: TestUtils.getResourceFileContent('bookstore.yang')]
@@ -44,7 +42,6 @@ class YangTextSchemaSourceSetSpec extends Specification {
             'RFC-6020 recommended' | 'bookstore-test@2020-09-15.YANG'
     }
 
-    @Unroll
     def 'Building YangTextSchemaSourceSet error case: #description.'() {
         given: 'a file with #description'
             def yangResourceNameToContent = TestUtils.getYangResourcesAsMap(filename)
index 0b00cbb..435426b 100644 (file)
@@ -26,7 +26,6 @@ import org.onap.cps.yang.YangTextSchemaSourceSetBuilder
 import org.opendaylight.yangtools.yang.common.QName
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode
 import spock.lang.Specification
-import spock.lang.Unroll
 
 class YangUtilsSpec extends Specification {
     def 'Parsing a valid Json String.'() {
@@ -41,7 +40,6 @@ class YangUtilsSpec extends Specification {
             result.nodeType == QName.create('org:onap:ccsdk:sample', '2020-09-15', 'bookstore')
     }
 
-    @Unroll
     def 'Parsing invalid data: #description.'() {
         given: 'a yang model (file)'
             def yangResourceNameToContent = TestUtils.getYangResourcesAsMap('bookstore.yang')
@@ -57,7 +55,6 @@ class YangUtilsSpec extends Specification {
             '{" }'                                            | 'json with syntax exception'
     }
 
-    @Unroll
     def 'Parsing json data fragment by xpath for #scenario.'() {
         given: 'schema context'
             def yangResourcesMap = TestUtils.getYangResourcesAsMap('test-tree.yang')
@@ -73,7 +70,6 @@ class YangUtilsSpec extends Specification {
             'container element'         | '{ "nest": { "name": "N", "birds": ["bird"] } }'                              | '/test-tree/branch[@name=\'Branch\']' || 'nest'
     }
 
-    @Unroll
     def 'Parsing json data fragment by xpath error scenario: #scenario.'() {
         given: 'schema context'
             def yangResourcesMap = TestUtils.getYangResourcesAsMap('test-tree.yang')