8fc27c5943445f2ba9cc6d793f1aa08d6bb6af5b
[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     private MockRestServiceServer mockRestServer;
38
39     @Autowired
40     private Sol003SubscriptionManagementController controller;
41
42     @Before
43     public void setUp() throws Exception {
44         mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build();
45     }
46
47     @Test
48     public void postSubscriptionRequest() throws URISyntaxException, InterruptedException {
49         final PkgmSubscriptionRequest pkgmSubscriptionRequest = new PkgmSubscriptionRequest();
50         final ResponseEntity<InlineResponse2002> response = controller.postSubscriptionRequest(pkgmSubscriptionRequest);
51         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
52     }
53
54     @Test
55     public void getSubscriptions() throws URISyntaxException, InterruptedException {
56         final ResponseEntity<List<InlineResponse2002>> response = controller.getSubscriptions();
57         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
58     }
59
60     @Test
61     public void deleteSubscription() throws URISyntaxException, InterruptedException {
62         final ResponseEntity<Void> response = controller.deleteSubscription(subscriptionId);
63         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
64     }
65
66     @Test
67     public void getSubscription() throws URISyntaxException, InterruptedException {
68         final ResponseEntity<InlineResponse2002> response = controller.getSubscription(subscriptionId);
69         assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
70     }
71 }