801c468018bf0ca4a25661ebcd4479d689cbbe78
[so.git] /
1 package org.onap.so.adapters.vnfmadapter.rest;
2
3
4 import static org.junit.Assert.assertEquals;
5 import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
6 import java.net.URISyntaxException;
7 import java.util.List;
8 import org.junit.Before;
9 import org.junit.Test;
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;
22
23 @RunWith(SpringRunner.class)
24 @SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
25 @ActiveProfiles("test")
26 public class Sol003PackageManagementControllerTest {
27
28     private static final String vnfPackageId = "myVnfPackageId";
29     private static final String artifactPath = "myArtifactPath";
30
31     @Autowired
32     @Qualifier(CONFIGURABLE_REST_TEMPLATE)
33     private RestTemplate testRestTemplate;
34     private MockRestServiceServer mockRestServer;
35
36     @Autowired
37     private Sol003PackageManagementController controller;
38
39     @Before
40     public void setUp() throws Exception {
41         mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build();
42     }
43
44     @Test
45     public void getVnfPackages() throws URISyntaxException, InterruptedException {
46         final ResponseEntity<List<InlineResponse2001>> response = controller.getVnfPackages();
47         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
48     }
49
50     @Test
51     public void getVnfPackage() throws URISyntaxException, InterruptedException {
52         final ResponseEntity<InlineResponse2001> response = controller.getVnfPackage(vnfPackageId);
53         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
54     }
55
56     @Test
57     public void getVnfPackageVnfd() throws URISyntaxException, InterruptedException {
58         final ResponseEntity<byte[]> response = controller.getVnfPackageVnfd(vnfPackageId);
59         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
60     }
61
62     @Test
63     public void getVnfPackageContents() throws URISyntaxException, InterruptedException {
64         final ResponseEntity<byte[]> response = controller.getVnfPackageContent(vnfPackageId);
65         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
66     }
67
68     @Test
69     public void getVnfPackageArtifact() throws URISyntaxException, InterruptedException {
70         final ResponseEntity<byte[]> response = controller.getVnfPackageArtifact(vnfPackageId, artifactPath);
71         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
72     }
73
74 }