summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshivasubedi <shiva.subedi@est.tech>2021-04-29 12:48:05 +0100
committerShiva Subedi <shiva.subedi@est.tech>2021-04-29 11:54:59 +0000
commit8a74ced574d566024513044859f433d263e3cc1b (patch)
treeded9f6e3ebffad554fc184ca231d4a0fa78e8c3f
parentff7ba3a74265b62b116abb2fc34767f87444a655 (diff)
Investigate and update Spock version
Issue-ID: CPS-368 Signed-off-by: shivasubedi <shiva.subedi@est.tech> Change-Id: Ie8505cf29068660af6bc6b9887f593f7e3be074f
-rwxr-xr-xcps-dependencies/pom.xml11
-rw-r--r--cps-ncmp-rest/pom.xml5
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy3
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy2
-rwxr-xr-xcps-rest/pom.xml5
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy3
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy8
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy2
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy3
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy3
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy5
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy7
-rwxr-xr-xcps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceSpec.groovy10
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy3
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/query/CpsPathQuerySpec.groovy6
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy4
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy2
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy3
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy3
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy4
20 files changed, 20 insertions, 72 deletions
diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml
index 63f86157ad..73aa36acca 100755
--- a/cps-dependencies/pom.xml
+++ b/cps-dependencies/pom.xml
@@ -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>
@@ -98,6 +98,11 @@
<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>
<version>${spock-core.version}</version>
diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml
index 9f0e132206..02a7898f67 100644
--- a/cps-ncmp-rest/pom.xml
+++ b/cps-ncmp-rest/pom.xml
@@ -76,6 +76,11 @@
<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>
<scope>test</scope>
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
index f0a3d09c21..ea3c16d4cb 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
@@ -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'
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
index 95493bf51e..0a00e34f7b 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
@@ -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'
diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml
index ce304f3328..1e535c4369 100755
--- a/cps-rest/pom.xml
+++ b/cps-rest/pom.xml
@@ -80,6 +80,11 @@
<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>
<scope>test</scope>
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
index 1ccd3ba661..e158ebdedc 100755
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
@@ -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"
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
index b7337e02a5..b64b56178a 100755
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
@@ -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'
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
index f3f1417f13..e42c75c2a1 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
@@ -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()
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
index 30d5b62a26..6c14dde466 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
@@ -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)
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy
index 2c3d46e5db..3f4729ec79 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy
@@ -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))
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)')
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
index 29a2314a33..8fbf74504b 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
@@ -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()
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
index 261d174934..d20149bc4e 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
@@ -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)
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy
index 99d25ecfc8..30945152ff 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy
@@ -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'
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy
index f7efd5dffd..e58f442129 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy
@@ -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)
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
index 0b00cbb835..435426b2a2 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
@@ -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')