diff options
author | Ruslan Kashapov <ruslan.kashapov@pantheon.tech> | 2021-04-05 14:46:03 +0300 |
---|---|---|
committer | Rishi Chail <rishi.chail@est.tech> | 2021-04-07 13:11:46 +0000 |
commit | b20858b706445a4e10b781070f6620e92587985c (patch) | |
tree | d08c7d689ef48bcfe7d7e62d5123be5b0c180236 /cps-rest/src/test | |
parent | 6b300ead182d9724658f0188631e538851e8f566 (diff) |
Delete anchor part 2: cps rest
Issue-ID: CPS-312
Change-Id: I08f92dfff3188bd96a69ec2ae01e0d0891b81d87
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Diffstat (limited to 'cps-rest/src/test')
-rwxr-xr-x | cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy | 14 |
1 files changed, 13 insertions, 1 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 3387fb4e1e..370ebaa6a4 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 @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020 Pantheon.tech + * Copyright (C) 2020-2021 Pantheon.tech * Modifications Copyright (C) 2020, 2021 Bell Canada. All rights reserved. * Copyright (C) 2021 Nordix Foundation * ================================================================================ @@ -290,6 +290,18 @@ class AdminRestControllerSpec extends Specification { responseContent.contains(schemaSetName) } + def 'Delete anchor.'() { + given: 'an endpoint' + def anchorEndpoint = "$basePath/v1/dataspaces/$dataspaceName/anchors/$anchorName" + when: 'delete method is invoked on anchor endpoint' + def response = mvc.perform(delete(anchorEndpoint)).andReturn().response + then: 'associated service method is invoked with expected parameters' + 1 * mockCpsAdminService.deleteAnchor(dataspaceName, anchorName) + and: 'response code indicates success' + response.status == HttpStatus.NO_CONTENT.value() + } + + def createMultipartFile(filename, content) { return new MockMultipartFile("file", filename, "text/plain", content.getBytes()) } |