diff options
author | rajesh.kumar <rk00747546@techmahindra.com> | 2022-09-06 11:47:18 +0000 |
---|---|---|
committer | rajesh.kumar <rk00747546@techmahindra.com> | 2022-11-18 06:37:38 +0000 |
commit | cec0cb7254ede8a790ec6f70ad5e31d10e2d32d7 (patch) | |
tree | 07e240bf7e384290b7bff198395e50af51eea994 /cps-service/src/test/groovy | |
parent | d2a1f36a78fdc69d43b39f0a7852d47d78924ed5 (diff) |
Added get APIs for dataspace.
Issue-ID: CPS-1186
Change-ID: I73f97f986a817d423f93a8d922dcd9647b0829aa
Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
Diffstat (limited to 'cps-service/src/test/groovy')
-rwxr-xr-x | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy index 2979c09866..e7d4e4ddb1 100755 --- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy @@ -3,6 +3,7 @@ * Copyright (C) 2020-2022 Nordix Foundation * Modifications Copyright (C) 2020-2022 Bell Canada. * Modifications Copyright (C) 2021 Pantheon.tech + * Modifications Copyright (C) 2022 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +26,7 @@ package org.onap.cps.api.impl import org.onap.cps.api.CpsDataService import org.onap.cps.spi.CpsAdminPersistenceService import org.onap.cps.spi.model.Anchor +import org.onap.cps.spi.model.Dataspace import org.onap.cps.spi.utils.CpsValidator import spock.lang.Specification import java.time.OffsetDateTime @@ -89,6 +91,22 @@ class CpsAdminServiceImplSpec extends Specification { 1 * mockCpsValidator.validateNameCharacters('someDataspace', 'someAnchor') } + def 'Retrieve dataspace.'() { + given: 'a dataspace is already created' + def dataspace = new Dataspace(name: "someDataspace") + mockCpsAdminPersistenceService.getDataspace('someDataspace') >> dataspace + expect: 'the dataspace provided by persistence service is returned as result' + assert objectUnderTest.getDataspace('someDataspace') == dataspace + } + + def 'Retrieve all dataspaces.'() { + given: 'that all given dataspaces are already created' + def dataspaces = [new Dataspace(name: "test-dataspace1"), new Dataspace(name: "test-dataspace2")] + mockCpsAdminPersistenceService.getAllDataspaces() >> dataspaces + expect: 'the dataspace provided by persistence service is returned as result' + assert objectUnderTest.getAllDataspaces() == dataspaces + } + def 'Delete anchor.'() { when: 'delete anchor is invoked' objectUnderTest.deleteAnchor('someDataspace','someAnchor') |