1 package org.onap.so.adapters.vnfmadapter.rest;
4 import static org.junit.Assert.assertEquals;
5 import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
6 import java.net.URISyntaxException;
8 import org.junit.Before;
10 import org.junit.runner.RunWith;
11 import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
12 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.beans.factory.annotation.Qualifier;
15 import org.springframework.boot.test.context.SpringBootTest;
16 import org.springframework.http.HttpStatus;
17 import org.springframework.http.ResponseEntity;
18 import org.springframework.test.context.ActiveProfiles;
19 import org.springframework.test.context.junit4.SpringRunner;
20 import org.springframework.test.web.client.MockRestServiceServer;
21 import org.springframework.web.client.RestTemplate;
23 @RunWith(SpringRunner.class)
24 @SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
25 @ActiveProfiles("test")
26 public class Sol003PackageManagementControllerTest {
28 private static final String vnfPackageId = "myVnfPackageId";
29 private static final String artifactPath = "myArtifactPath";
32 @Qualifier(CONFIGURABLE_REST_TEMPLATE)
33 private RestTemplate testRestTemplate;
34 private MockRestServiceServer mockRestServer;
37 private Sol003PackageManagementController controller;
40 public void setUp() throws Exception {
41 mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build();
45 public void getVnfPackages() throws URISyntaxException, InterruptedException {
46 final ResponseEntity<List<InlineResponse2001>> response = controller.getVnfPackages();
47 assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
51 public void getVnfPackage() throws URISyntaxException, InterruptedException {
52 final ResponseEntity<InlineResponse2001> response = controller.getVnfPackage(vnfPackageId);
53 assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
57 public void getVnfPackageVnfd() throws URISyntaxException, InterruptedException {
58 final ResponseEntity<byte[]> response = controller.getVnfPackageVnfd(vnfPackageId);
59 assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
63 public void getVnfPackageContents() throws URISyntaxException, InterruptedException {
64 final ResponseEntity<byte[]> response = controller.getVnfPackageContent(vnfPackageId);
65 assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
69 public void getVnfPackageArtifact() throws URISyntaxException, InterruptedException {
70 final ResponseEntity<byte[]> response = controller.getVnfPackageArtifact(vnfPackageId, artifactPath);
71 assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());