summaryrefslogtreecommitdiffstats
path: root/cps-rest/src/test/groovy
diff options
context:
space:
mode:
Diffstat (limited to 'cps-rest/src/test/groovy')
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy14
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 ab4cf7c1f..1ccd3ba66 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
* ================================================================================
@@ -308,6 +308,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())
}