diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2021-02-26 11:35:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-26 11:35:17 +0000 |
commit | d3609db46635b9bdb0a49a7d0e18ebe144bb7f29 (patch) | |
tree | ac1031feb7f07e2f972c30d97d5c1fe747f98f37 /cps-rest | |
parent | b4f6f0509e4bb97ba0ed24c3b8906905d656c682 (diff) | |
parent | 83e318f8c7d3cacb24b2ef9b76162b0af12e817c (diff) |
Merge "Implement getDataNode(anchorName, xPath) in NF-Proxy"
Diffstat (limited to 'cps-rest')
-rw-r--r-- | cps-rest/src/test/groovy/org/onap/cps/rest/utils/MultipartFileUtilSpec.groovy | 11 |
1 files changed, 11 insertions, 0 deletions
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 3e2bdec37e..2c3d46e5db 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 @@ -21,6 +21,8 @@ package org.onap.cps.rest.utils import org.onap.cps.spi.exceptions.CpsException import org.onap.cps.spi.exceptions.ModelValidationException +import org.onap.cps.spi.model.DataNodeBuilder +import org.onap.cps.utils.DataMapUtils import org.springframework.mock.web.MockMultipartFile import org.springframework.web.multipart.MultipartFile import spock.lang.Specification @@ -28,6 +30,15 @@ import spock.lang.Unroll class MultipartFileUtilSpec extends Specification { + def 'Data node without leaves and without children.'() { + given: 'a datanode with no leaves and no children' + def dataNodeWithoutData = new DataNodeBuilder().withXpath('some xpath').build() + when: 'it is converted to a map' + def result = DataMapUtils.toDataMap(dataNodeWithoutData) + then: 'an empty object map is returned' + result.isEmpty() + } + def 'Extract yang resource from yang file.'() { given: 'uploaded yang file' def multipartFile = new MockMultipartFile("file", "filename.yang", "text/plain", "content".getBytes()) |