diff options
author | niamhcore <niamh.core@est.tech> | 2021-03-01 13:25:13 +0000 |
---|---|---|
committer | Niamh Core <niamh.core@est.tech> | 2021-03-02 11:13:25 +0000 |
commit | 32446dce35b5bf9d2c84751718cb4ece7f96fa72 (patch) | |
tree | 03a0fb6b16c6c6e692bc54db74440d005c501573 /cps-service/src/test/groovy | |
parent | 7c981df521c9d8eb6f340b2b118491eeeb21ae59 (diff) |
CPS-265 - updating cps path to support include-descendants option.
Issue-ID: CPS-265
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I9e9b84760dbc8b5eb4b31ab972fdb2d186c6bb48
Diffstat (limited to 'cps-service/src/test/groovy')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsQueryServiceImplSpec.groovy | 12 |
1 files changed, 9 insertions, 3 deletions
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 6e044b0444..99d25ecfc8 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 @@ -20,7 +20,10 @@ 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) @@ -31,14 +34,17 @@ class CpsQueryServiceImplSpec extends Specification { objectUnderTest.cpsDataPersistenceService = mockCpsDataPersistenceService } - def 'Query data nodes by cps path.'() { + @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' def anchorName = 'some anchor' def cpsPath = '/cps-path' when: 'queryDataNodes is invoked' - objectUnderTest.queryDataNodes(dataspaceName, anchorName, cpsPath) + objectUnderTest.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption) then: 'the persistence service is called once with the correct parameters' - 1 * mockCpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath) + 1 * mockCpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption) + where: 'all fetch descendants options are supported' + fetchDescendantsOption << FetchDescendantsOption.values() } }
\ No newline at end of file |