diff options
author | niamhcore <niamh.core@est.tech> | 2021-11-22 11:44:38 +0000 |
---|---|---|
committer | niamhcore <niamh.core@est.tech> | 2021-11-23 10:53:39 +0000 |
commit | 09c6b6e1fa2684c913d7b904f7c7ad6b26b04ef1 (patch) | |
tree | 63481d02e24d1277341d74db68614e7fd3680a41 /cps-service/src/test | |
parent | 9e09fe868b39fd5f13092a923da3474deb0f75b9 (diff) |
CPS-314: Delete Dataspace
Issue-ID: CPS-314
Change-Id: I778e2b784c7b1ff3fecc1036425708dc4ec73227
Signed-off-by: niamhcore <niamh.core@est.tech>
Diffstat (limited to 'cps-service/src/test')
-rwxr-xr-x | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy | 8 | ||||
-rwxr-xr-x | cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy | 8 |
2 files changed, 16 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 95afeb4172..6d1f586295 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 @@ -78,4 +78,12 @@ class CpsAdminServiceImplSpec extends Specification { objectUnderTest.queryAnchorNames('some-dataspace-name', ['some-module-name']) == ['some-anchor-identifier'] } + + def 'Delete dataspace.'() { + when: 'delete dataspace is invoked' + objectUnderTest.deleteDataspace('someDataspace') + then: 'associated persistence service method is invoked with correct parameter' + 1 * mockCpsAdminPersistenceService.deleteDataspace('someDataspace') + } + } diff --git a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy index 4243c18c24..5bd3678346 100755 --- a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy @@ -170,4 +170,12 @@ class CpsExceptionsSpec extends Specification { expect: 'the exception has the provided details' exception.details == providedDetails } + + def 'Creating an exception that the dataspace is being used and cannot be deleted.'() { + given: 'a dataspace in use exception is created' + def exception = new DataspaceInUseException(dataspaceName,providedDetails) + expect: 'the exception has the correct message with dataspace name and provided details' + exception.message == "Dataspace with name ${dataspaceName} is being used." + exception.details == providedDetails + } } |