03a6c40f35ef707561733b0090badc77bbf69802
[vid.git] / vid-app-common / src / test / java / org / onap / vid / controller / MsoControllerNewTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.vid.controller;
22
23 import static org.mockito.Mockito.mock;
24
25 import javax.servlet.http.HttpServletRequest;
26 import org.junit.Test;
27 import org.onap.vid.mso.MsoBusinessLogicImpl;
28 import org.onap.vid.mso.MsoInterface;
29 import org.onap.vid.mso.RestMsoImplementation;
30 import org.onap.vid.mso.rest.RequestDetails;
31 import org.onap.vid.mso.rest.RequestDetailsWrapper;
32 import org.onap.vid.services.CloudOwnerServiceImpl;
33 import org.springframework.http.ResponseEntity;
34
35 public class MsoControllerNewTest {
36
37     private MsoController createTestSubject() {
38         try {
39             return new MsoController(new MsoBusinessLogicImpl(mock(MsoInterface.class)), mock(RestMsoImplementation.class),
40                 new CloudOwnerServiceImpl(null, null));
41         } catch (Exception e) {
42             return null;
43         }
44     }
45
46     @Test
47     public void testCreateSvcInstance() throws Exception {
48         MsoController testSubject;
49         HttpServletRequest request = null;
50         RequestDetails mso_request = null;
51         ResponseEntity<String> result;
52
53         // default test
54         try {
55             testSubject = createTestSubject();
56             result = testSubject.createSvcInstance(request, mso_request);
57         } catch (Exception e) {
58         }
59     }
60
61     @Test
62     public void testCreateVnf() throws Exception {
63         MsoController testSubject;
64         String serviceInstanceId = "";
65         HttpServletRequest request = null;
66         RequestDetails mso_request = null;
67         ResponseEntity<String> result;
68
69         // default test
70         try {
71             testSubject = createTestSubject();
72             result = testSubject.createVnf(serviceInstanceId, request, mso_request);
73         } catch (Exception e) {
74         }
75     }
76
77     @Test
78     public void testCreateNwInstance() throws Exception {
79         MsoController testSubject;
80         String serviceInstanceId = "";
81         HttpServletRequest request = null;
82         RequestDetails mso_request = null;
83         ResponseEntity<String> result;
84
85         // default test
86         try {
87             testSubject = createTestSubject();
88             result = testSubject.createNwInstance(serviceInstanceId, request, mso_request);
89         } catch (Exception e) {
90         }
91     }
92
93     @Test
94     public void testCreateVolumeGroupInstance() throws Exception {
95         MsoController testSubject;
96         String serviceInstanceId = "";
97         String vnfInstanceId = "";
98         HttpServletRequest request = null;
99         RequestDetails mso_request = null;
100         ResponseEntity<String> result;
101
102         // default test
103         try {
104             testSubject = createTestSubject();
105             result = testSubject.createVolumeGroupInstance(serviceInstanceId, vnfInstanceId, request, mso_request);
106         } catch (Exception e) {
107         }
108     }
109
110     @Test
111     public void testCreateVfModuleInstance() throws Exception {
112         MsoController testSubject;
113         String serviceInstanceId = "";
114         String vnfInstanceId = "";
115         HttpServletRequest request = null;
116         RequestDetails mso_request = null;
117         ResponseEntity<String> result;
118
119         // default test
120         try {
121             testSubject = createTestSubject();
122             result = testSubject.createVfModuleInstance(serviceInstanceId, vnfInstanceId, request, mso_request);
123         } catch (Exception e) {
124         }
125     }
126
127     @Test
128     public void testCreateConfigurationInstance() throws Exception {
129         MsoController testSubject;
130         String serviceInstanceId = "";
131         HttpServletRequest request = null;
132         RequestDetailsWrapper mso_request = null;
133         ResponseEntity<String> result;
134
135         // default test
136         try {
137             testSubject = createTestSubject();
138             result = testSubject.createConfigurationInstance(serviceInstanceId, request, mso_request);
139         } catch (Exception e) {
140         }
141     }
142
143     @Test
144     public void testDeleteSvcInstance() throws Exception {
145         MsoController testSubject;
146         String serviceInstanceId = "";
147         HttpServletRequest request = null;
148         RequestDetails mso_request = null;
149         String result;
150
151         // default test
152         try {
153             testSubject = createTestSubject();
154             result = testSubject.deleteSvcInstance(serviceInstanceId, request, mso_request, "");
155         } catch (Exception e) {
156         }
157     }
158
159     @Test
160     public void testDeleteVnf() throws Exception {
161         MsoController testSubject;
162         String serviceInstanceId = "";
163         String vnfInstanceId = "";
164         HttpServletRequest request = null;
165         RequestDetails mso_request = null;
166         ResponseEntity<String> result;
167
168         // default test
169         try {
170             testSubject = createTestSubject();
171             result = testSubject.deleteVnf(serviceInstanceId, vnfInstanceId, request, mso_request);
172         } catch (Exception e) {
173         }
174     }
175
176     @Test
177     public void testDeleteConfiguration() throws Exception {
178         MsoController testSubject;
179         String serviceInstanceId = "";
180         String configurationId = "";
181         RequestDetailsWrapper mso_request = null;
182         ResponseEntity<String> result;
183
184         // default test
185         try {
186             testSubject = createTestSubject();
187             result = testSubject.deleteConfiguration(serviceInstanceId, configurationId, mso_request);
188         } catch (Exception e) {
189         }
190     }
191
192     @Test
193     public void testActivateConfiguration() throws Exception {
194         MsoController testSubject;
195         String serviceInstanceId = "";
196         String configurationId = "";
197         RequestDetails mso_request = null;
198         ResponseEntity<String> result;
199
200         // default test
201         try {
202             testSubject = createTestSubject();
203             result = testSubject.activateConfiguration(serviceInstanceId, configurationId, mso_request);
204         } catch (Exception e) {
205         }
206     }
207
208     @Test
209     public void testDeactivateConfiguration() throws Exception {
210         MsoController testSubject;
211         String serviceInstanceId = "";
212         String configurationId = "";
213         RequestDetails mso_request = null;
214         ResponseEntity<String> result;
215
216         // default test
217         try {
218             testSubject = createTestSubject();
219             result = testSubject.deactivateConfiguration(serviceInstanceId, configurationId, mso_request);
220         } catch (Exception e) {
221         }
222     }
223
224     @Test
225     public void testDisablePortOnConfiguration() throws Exception {
226         MsoController testSubject;
227         String serviceInstanceId = "";
228         String configurationId = "";
229         RequestDetails mso_request = null;
230         ResponseEntity<String> result;
231
232         // default test
233         try {
234             testSubject = createTestSubject();
235             result = testSubject.disablePortOnConfiguration(serviceInstanceId, configurationId, mso_request);
236         } catch (Exception e) {
237         }
238     }
239
240     @Test
241     public void testEnablePortOnConfiguration() throws Exception {
242         MsoController testSubject;
243         String serviceInstanceId = "";
244         String configurationId = "";
245         RequestDetails mso_request = null;
246         ResponseEntity<String> result;
247
248         // default test
249         try {
250             testSubject = createTestSubject();
251             result = testSubject.enablePortOnConfiguration(serviceInstanceId, configurationId, mso_request);
252         } catch (Exception e) {
253         }
254     }
255
256     @Test
257     public void testDeleteVfModule() throws Exception {
258         MsoController testSubject;
259         String serviceInstanceId = "";
260         String vnfInstanceId = "";
261         String vfModuleId = "";
262         HttpServletRequest request = null;
263         RequestDetails mso_request = null;
264         ResponseEntity<String> result;
265
266         // default test
267         try {
268             testSubject = createTestSubject();
269             result = testSubject.deleteVfModule(serviceInstanceId, vnfInstanceId, vfModuleId, request, mso_request);
270         } catch (Exception e) {
271         }
272     }
273
274     @Test
275     public void testDeleteVolumeGroupInstance() throws Exception {
276         MsoController testSubject;
277         String serviceInstanceId = "";
278         String vnfInstanceId = "";
279         String volumeGroupId = "";
280         HttpServletRequest request = null;
281         RequestDetails mso_request = null;
282         ResponseEntity<String> result;
283
284         // default test
285         try {
286             testSubject = createTestSubject();
287             result = testSubject.deleteVolumeGroupInstance(serviceInstanceId, vnfInstanceId, volumeGroupId, request,
288                     mso_request);
289         } catch (Exception e) {
290         }
291     }
292
293     @Test
294     public void testDeleteNwInstance() throws Exception {
295         MsoController testSubject;
296         String serviceInstanceId = "";
297         String networkInstanceId = "";
298         HttpServletRequest request = null;
299         RequestDetails mso_request = null;
300         ResponseEntity<String> result;
301
302         // default test
303         try {
304             testSubject = createTestSubject();
305             result = testSubject.deleteNwInstance(serviceInstanceId, networkInstanceId, request, mso_request);
306         } catch (Exception e) {
307         }
308     }
309
310     @Test
311     public void testGetOrchestrationRequest() throws Exception {
312         MsoController testSubject;
313         String requestId = "";
314         HttpServletRequest request = null;
315         ResponseEntity<String> result;
316
317         // default test
318         try {
319             testSubject = createTestSubject();
320             result = testSubject.getOrchestrationRequest(requestId, request);
321         } catch (Exception e) {
322         }
323     }
324
325     @Test
326     public void testGetOrchestrationRequests() throws Exception {
327         MsoController testSubject;
328         String filterString = "";
329         HttpServletRequest request = null;
330         ResponseEntity<String> result;
331
332         // default test
333         try {
334             testSubject = createTestSubject();
335             result = testSubject.getOrchestrationRequests(filterString, request);
336         } catch (Exception e) {
337         }
338     }
339
340     @Test
341     public void testActivateServiceInstance() throws Exception {
342         MsoController testSubject;
343         String serviceInstanceId = "";
344         RequestDetails requestDetails = null;
345         ResponseEntity<String> result;
346
347         // default test
348         try {
349             testSubject = createTestSubject();
350             result = testSubject.activateServiceInstance(serviceInstanceId, requestDetails);
351         } catch (Exception e) {
352         }
353     }
354
355     @Test
356     public void testDeactivateServiceInstance() throws Exception {
357         MsoController testSubject;
358         String serviceInstanceId = "";
359         RequestDetails requestDetails = null;
360         ResponseEntity<String> result;
361
362         // default test
363         try {
364             testSubject = createTestSubject();
365             result = testSubject.deactivateServiceInstance(serviceInstanceId, requestDetails);
366         } catch (Exception e) {
367         }
368     }
369
370     @Test
371     public void testManualTaskComplete() throws Exception {
372         MsoController testSubject;
373         String taskId = "";
374         RequestDetails requestDetails = null;
375         ResponseEntity<String> result;
376
377         // default test
378         try {
379             testSubject = createTestSubject();
380             result = testSubject.manualTaskComplete(taskId, requestDetails);
381         } catch (Exception e) {
382         }
383     }
384
385     @Test
386     public void testRemoveRelationshipFromServiceInstance() throws Exception {
387         MsoController testSubject;
388         String serviceInstanceId = "";
389         RequestDetails requestDetails = null;
390         ResponseEntity<String> result;
391
392         // default test
393         try {
394             testSubject = createTestSubject();
395             result = testSubject.removeRelationshipFromServiceInstance(serviceInstanceId, requestDetails);
396         } catch (Exception e) {
397         }
398     }
399
400     @Test
401     public void testAddRelationshipToServiceInstance() throws Exception {
402         MsoController testSubject;
403         String serviceInstanceId = "";
404         RequestDetails requestDetails = null;
405         ResponseEntity<String> result;
406
407         // default test
408         try {
409             testSubject = createTestSubject();
410             result = testSubject.addRelationshipToServiceInstance(serviceInstanceId, requestDetails);
411         } catch (Exception e) {
412         }
413     }
414 }