summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2019-03-25 10:51:21 +0000
committerMichaelMorris <michael.morris@est.tech>2019-03-25 10:51:21 +0000
commit0d97f87b6381ea06350933b375c4e821b5e10568 (patch)
treefd5865146427119400dceae65dad58175df374be /adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java
parent7815bcec2a85b023f3004e698712cea7fed2f94e (diff)
Create empty implementation of delete VNF request
The implementation provides no functionality (just logs the call and returns 202 with a job id) but enables invocation of the adapter from a flow Issue-ID: SO-1632 Change-Id: Ie71699e917173c77b217e8a9f5eb9e5b794155a7 Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java')
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
index 842b3b56be..071a330e8b 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
@@ -28,6 +28,7 @@ import org.junit.runner.RunWith;
import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -75,4 +76,15 @@ public class VnfmAdapterControllerTest {
assertEquals(401, response.getStatusCode().value());
}
+ @Test
+ public void deleteVnf_ValidRequest_Returns202AndJobId() throws Exception {
+ final RequestEntity<Void> request = RequestEntity
+ .delete(new URI("http://localhost:" + port + "/so/vnfm-adapter/v1/vnfs/myVnfId"))
+ .accept(MediaType.APPLICATION_JSON).header("X-ONAP-RequestId", "myRequestId")
+ .header("X-ONAP-InvocationID", "myInvocationId").header("Content-Type", "application/json").build();
+ final ResponseEntity<DeleteVnfResponse> response = restTemplate.exchange(request, DeleteVnfResponse.class);
+ assertEquals(202, response.getStatusCode().value());
+ assertNotNull(response.getBody().getJobId());
+ }
+
}