X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=cps-rest%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Frest%2Fcontroller%2FAdminRestControllerSpec.groovy;h=e8cfcfb6f605cd9c4d66f42617e8e66cf5d14685;hb=09c6b6e1fa2684c913d7b904f7c7ad6b26b04ef1;hp=84da2db5d713eddedf08744291fdd4a658b52b70;hpb=9e09fe868b39fd5f13092a923da3474deb0f75b9;p=cps.git 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 84da2db5d7..e8cfcfb6f6 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 @@ -311,6 +311,18 @@ class AdminRestControllerSpec extends Specification { response.status == HttpStatus.NO_CONTENT.value() } + def 'Delete dataspace.'() { + given: 'an endpoint' + def dataspaceEndpoint = "$basePath/v1/dataspaces" + when: 'delete dataspace endpoint is invoked' + def response = mvc.perform(delete(dataspaceEndpoint) + .param('dataspace-name', dataspaceName)) + .andReturn().response + then: 'associated service method is invoked with expected parameter' + 1 * mockCpsAdminService.deleteDataspace(dataspaceName) + and: 'response code indicates success' + response.status == HttpStatus.NO_CONTENT.value() + } def createMultipartFile(filename, content) { return new MockMultipartFile("file", filename, "text/plain", content.getBytes()) @@ -333,4 +345,5 @@ class AdminRestControllerSpec extends Specification { multipartFile.getInputStream() >> { throw new IOException() } return multipartFile } + }