### Question:
VfcManager { public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException { LOGGER.info("delete ns -> begin"); String url = getUrl(nsInstanceId, CommonConstant.Step.DELETE); String methodType = CommonConstant.MethodType.DELETE; RestfulResponse deleteRsp = restfulUtil.send(url, methodType, ""); ValidateUtil.assertObjectNotNull(deleteRsp); LOGGER.info("delete ns response status is : {}", deleteRsp.getStatus()); LOGGER.info("delete ns response content is : {}", deleteRsp.getResponseContent()); LOGGER.info("delete ns -> end"); ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(), nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); if (!HttpCode.isSucess(deleteRsp.getStatus())) { LOGGER.error("fail to delete ns"); status.setStatus(RequestsDbConstant.Status.ERROR); status.setErrorCode(String.valueOf(deleteRsp.getStatus())); status.setStatusDescription(CommonConstant.StatusDesc.TERMINATE_NS_FAILED); resourceOperationStatusRepository.save(status); throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_DELETE_NS); } AaiUtil.removeRelation(nsOperationKey.getGlobalSubscriberId(), nsOperationKey.getServiceType(), nsOperationKey.getServiceId(), nsInstanceId); LOGGER.info("delete segment information -> end"); status.setStatus(RequestsDbConstant.Status.FINISHED); status.setErrorCode(String.valueOf(deleteRsp.getStatus())); status.setProgress("100"); status.setStatusDescription("VFC resource deletion finished"); resourceOperationStatusRepository.save(status); LOGGER.info("update segment operaton status for delete -> end"); return deleteRsp; } VfcManager(); RestfulResponse createNs(NSResourceInputParameter segInput); RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId); RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput); RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId); RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId); RestfulResponse scaleNs(String nsInstanceId, NSResourceInputParameter segInput);  }### Answer:
@Test public void deleteNs() throws Exception { RestfulResponse restfulResponse = new RestfulResponse(); restfulResponse.setStatus(HttpStatus.OK.value()); restfulResponse.setResponseContent("{\"" + CommonConstant.NS_INSTANCE_ID + "\": \"someNsInstanceId\"}"); when(restfulUtil.send(any(), any(), any())).thenReturn(restfulResponse); NsOperationKey nsOperationKey = new NsOperationKey(); RestfulResponse response = vfcManager.deleteNs(nsOperationKey, "someNsInstanceId"); assertEquals(HttpStatus.OK.value(), restfulResponse.getStatus()); }