X-Git-Url: https://gerrit.onap.org/r/gitweb?p=cps.git;a=blobdiff_plain;f=cps-rest%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Frest%2Fcontroller%2FAdminRestControllerSpec.groovy;h=41ad9ca5b242ae020b163095512de104479503da;hp=58a5ebf0482ac75452541f5a9ccb4a4e1bb8d8f2;hb=1839f38e054a958793ec40f524d911253086c74e;hpb=a0bbcfd8de94bb433e787b1a6ee400c988975850 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 58a5ebf04..41ad9ca5b 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 }