Updating etsi catalog endpoint param name
[so.git] / adapters / mso-vnfm-adapter / mso-vnfm-etsi-adapter / src / test / java / org / onap / so / adapters / vnfmadapter / rest / Sol003SubscriptionManagementControllerTest.java
1 package org.onap.so.adapters.vnfmadapter.rest;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
5 import java.net.URISyntaxException;
6 import java.util.List;
7 import org.junit.Before;
8 import org.junit.Test;
9 import org.junit.runner.RunWith;
10 import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
11 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2002;
12 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest;
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 /**
24  * @author gareth.roper@est.tech
25  */
26
27 @RunWith(SpringRunner.class)
28 @SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
29 @ActiveProfiles("test")
30 public class Sol003SubscriptionManagementControllerTest {
31
32     private static final String subscriptionId = "mySubscriptionId";
33
34     @Autowired
35     @Qualifier(CONFIGURABLE_REST_TEMPLATE)
36     private RestTemplate testRestTemplate;
37
38     @Autowired
39     private Sol003SubscriptionManagementController controller;
40
41     @Before
42     public void setUp() throws Exception {
43         MockRestServiceServer.bindTo(testRestTemplate).build();
44     }
45
46     @Test
47     public void postSubscriptionRequest() throws URISyntaxException, InterruptedException {
48         final PkgmSubscriptionRequest pkgmSubscriptionRequest = new PkgmSubscriptionRequest();
49         final ResponseEntity<InlineResponse2002> response = controller.postSubscriptionRequest(pkgmSubscriptionRequest);
50         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
51     }
52
53     @Test
54     public void getSubscriptions() throws URISyntaxException, InterruptedException {
55         final ResponseEntity<List<InlineResponse2002>> response = controller.getSubscriptions();
56         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
57     }
58
59     @Test
60     public void deleteSubscription() throws URISyntaxException, InterruptedException {
61         final ResponseEntity<Void> response = controller.deleteSubscription(subscriptionId);
62         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
63     }
64
65     @Test
66     public void getSubscription() throws URISyntaxException, InterruptedException {
67         final ResponseEntity<InlineResponse2002> response = controller.getSubscription(subscriptionId);
68         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
69     }
70 }