diff options
Diffstat (limited to 'cps-service/src/test/groovy/org/onap')
-rwxr-xr-x[-rw-r--r--] | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAdminServiceImplSpec.groovy | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy | 8 |
2 files changed, 11 insertions, 6 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 022282493b..5aaa340271 100644..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 @@ -41,17 +41,16 @@ class CpsAdminServiceImplSpec extends Specification { def 'Create anchor method invokes persistence service'() { when: 'Create anchor method is invoked' - objectUnderTest.createAnchor('dummyDataspace', 'dummySchemaSet', 'dummyAnchorName') + objectUnderTest.createAnchor('someDataspace', 'someSchemaSet', 'someAnchorName') then: 'The persistence service method is invoked with same parameters' - 1 * mockCpsAdminPersistenceService.createAnchor('dummyDataspace', 'dummySchemaSet', 'dummyAnchorName') + 1 * mockCpsAdminPersistenceService.createAnchor('someDataspace', 'someSchemaSet', 'someAnchorName') } def 'Retrieve all anchors for dataspace'() { given: 'that anchor is associated with the dataspace' Collection<Anchor> anchorCollection = Arrays.asList(new Anchor()) - mockCpsAdminPersistenceService.getAnchors('dummyDataspace') >> { anchorCollection } + mockCpsAdminPersistenceService.getAnchors('someDataspace') >> { anchorCollection } expect: 'the collection provided by persistence service is returned as result' - objectUnderTest.getAnchors('dummyDataspace') == anchorCollection + objectUnderTest.getAnchors('someDataspace') == anchorCollection } - } 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 067556dd58..e00a640d47 100644..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 @@ -104,4 +104,10 @@ class CpsExceptionsSpec extends Specification { (new SchemaSetNotFoundException(dataspaceName,schemaSetName)).details == "Schema Set with name ${schemaSetName} was not found for dataspace ${dataspaceName}." } -} + + def 'Creating a exception that an anchor cannot be found.'() { + expect: 'the exception details contains the correct message with dataspace and anchor name' + (new AnchorNotFoundException(anchorName, dataspaceName)).details + == "Anchor with name ${anchorName} does not exist in dataspace ${dataspaceName}." + } +}
\ No newline at end of file |