summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest/src')
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java10
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy7
2 files changed, 7 insertions, 10 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
index 0ad30f19c1..e3c457eaf4 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
@@ -62,6 +62,7 @@ import org.springframework.web.bind.annotation.RestController;
public class NetworkCmProxyController implements NetworkCmProxyApi {
private static final Gson GSON = new GsonBuilder().create();
+ private static final String NO_BODY = null;
private final ModelMapper modelMapper = new ModelMapper();
private final NetworkCmProxyDataService networkCmProxyDataService;
@@ -250,18 +251,15 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
*
* @param resourceIdentifier resource identifier
* @param cmHandle cm handle identifier
- * @param requestBody the request body
* @param contentType content type of the body
* @return response entity no content if request is successful
*/
@Override
- public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String resourceIdentifier,
- final String cmHandle,
- final Object requestBody,
+ public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String cmHandle,
+ final String resourceIdentifier,
final String contentType) {
-
networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
- resourceIdentifier, DELETE, GSON.toJson(requestBody), contentType);
+ resourceIdentifier, DELETE, NO_BODY, contentType);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
index c75418c78f..a3d8afaf24 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
@@ -318,11 +318,10 @@ class NetworkCmProxyControllerSpec extends Specification {
"?resourceIdentifier=parent/child"
when: 'delete data resource request is performed'
def response = mvc.perform(
- delete(url).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)
- .content(jsonString)).andReturn().response
- then: 'the ncmp service method to delete resource is called'
+ delete(url).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)).andReturn().response
+ then: 'the ncmp service method to delete resource is called (with null as body)'
1 * mockNetworkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle('testCmHandle',
- 'parent/child', DELETE, jsonString, 'application/json;charset=UTF-8')
+ 'parent/child', DELETE, null, 'application/json;charset=UTF-8')
and: 'the response is No Content'
response.status == HttpStatus.NO_CONTENT.value()
}