diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2021-11-23 14:56:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-11-23 14:56:49 +0000 |
commit | a84a4aa84fd22af9b89424d776a18a98d7515bd2 (patch) | |
tree | 002b2d3b6a77c6a96b6f2ef1a6057e9d8445d386 /cps-service/src/test/groovy | |
parent | f7b414e85fe4bd4a227e24cc4bbccd9568b188fa (diff) | |
parent | 09c6b6e1fa2684c913d7b904f7c7ad6b26b04ef1 (diff) |
Merge "CPS-314: Delete Dataspace"
Diffstat (limited to 'cps-service/src/test/groovy')
-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 + } } |