diff options
author | 2022-03-31 13:08:13 +0000 | |
---|---|---|
committer | 2022-03-31 13:08:13 +0000 | |
commit | 169e5a8d73488882673df70574ac96e765f81568 (patch) | |
tree | 11cc698da592adb4e40d59679022faceb604011e /cps-rest/src | |
parent | 41897f6465b534eaac4b960bba6f4491ea4d9d15 (diff) | |
parent | 1839f38e054a958793ec40f524d911253086c74e (diff) |
Merge "Additional validation for names/identifiers"
Diffstat (limited to 'cps-rest/src')
-rwxr-xr-x | cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy index 58a5ebf048..41ad9ca5b2 100755 --- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy +++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy @@ -22,14 +22,13 @@ package org.onap.cps.rest.controller -import org.mapstruct.factory.Mappers - import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post +import org.mapstruct.factory.Mappers import org.onap.cps.api.CpsAdminService import org.onap.cps.api.CpsModuleService import org.onap.cps.spi.exceptions.AlreadyDefinedException @@ -73,7 +72,7 @@ class AdminRestControllerSpec extends Specification { def 'Create new dataspace.'() { given: 'an endpoint' - def createDataspaceEndpoint = "$basePath/v1/dataspaces"; + def createDataspaceEndpoint = "$basePath/v1/dataspaces" when: 'post is invoked' def response = mvc.perform( @@ -88,7 +87,7 @@ class AdminRestControllerSpec extends Specification { def 'Create dataspace over existing with same name.'() { given: 'an endpoint' - def createDataspaceEndpoint = "$basePath/v1/dataspaces"; + def createDataspaceEndpoint = "$basePath/v1/dataspaces" and: 'the service method throws an exception indicating the dataspace is already defined' def thrownException = new AlreadyDefinedException(dataspaceName, new RuntimeException()) mockCpsAdminService.createDataspace(dataspaceName) >> { throw thrownException } |