2a398b3612663dab070e0bcdc2aa6436c92d2072
[vid.git] / vid-app-common / src / test / java / org / onap / vid / controllers / AaiControllerTest.java
1 package org.onap.vid.controllers;
2
3 import javax.servlet.http.HttpServletRequest;
4
5 import org.json.simple.JSONObject;
6 import org.junit.Test;
7 import org.onap.vid.aai.AaiResponse;
8 import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
9 import org.onap.vid.controllers.AaiController;
10 import org.onap.vid.model.VersionByInvariantIdsRequest;
11 import org.springframework.http.ResponseEntity;
12 import org.springframework.web.servlet.ModelAndView;
13 import java.util.*;
14 import org.junit.Assert;
15
16 public class AaiControllerTest {
17
18     private AaiController createTestSubject() {
19         return new AaiController();
20     }
21
22     @Test
23     public void testWelcome() throws Exception {
24         AaiController testSubject;
25         HttpServletRequest request = null;
26         ModelAndView result;
27
28         // default test
29         testSubject = createTestSubject();
30         result = testSubject.welcome(request);
31     }
32
33     @Test
34     public void testGetTargetProvStatus() throws Exception {
35         AaiController testSubject;
36         ResponseEntity<String> result;
37
38         // default test
39         testSubject = createTestSubject();
40         result = testSubject.getTargetProvStatus();
41     }
42
43     @Test
44     public void testViewEditGetTenantsFromServiceType() throws Exception {
45         AaiController testSubject;
46         HttpServletRequest request = null;
47         String globalCustomerId = "";
48         String serviceType = "";
49         ResponseEntity<String> result;
50
51         // default test
52         testSubject = createTestSubject();
53         result = testSubject.viewEditGetTenantsFromServiceType(request, globalCustomerId, serviceType);
54     }
55
56     
57     
58     
59     
60     @Test
61     public void testGetAicZones() throws Exception {
62         AaiController testSubject;
63         HttpServletRequest request = null;
64         ResponseEntity<String> result;
65
66         // default test
67         try {
68             testSubject = createTestSubject();
69             result = testSubject.getAicZones(request);
70         } catch (Exception e) {
71         }
72     }
73
74     @Test
75     public void testGetAicZoneForPnf() throws Exception {
76         AaiController testSubject;
77         String globalCustomerId = "";
78         String serviceType = "";
79         String serviceId = "";
80         HttpServletRequest request = null;
81         ResponseEntity<String> result;
82
83         // default test
84         try {
85             testSubject = createTestSubject();
86             result = testSubject.getAicZoneForPnf(globalCustomerId, serviceType, serviceId, request);
87         } catch (Exception e) {
88         }
89     }
90
91     @Test
92     public void testGetUserID() throws Exception {
93         AaiController testSubject;
94         HttpServletRequest request = null;
95         ResponseEntity<String> result;
96
97         // default test
98         try {
99             testSubject = createTestSubject();
100             result = testSubject.getUserID(request);
101         } catch (Exception e) {
102         }
103     }
104
105     @Test
106     public void testDoGetServices() throws Exception {
107         AaiController testSubject;
108         HttpServletRequest request = null;
109         ResponseEntity<String> result;
110
111         // default test
112         try {
113             testSubject = createTestSubject();
114             result = testSubject.doGetServices(request);
115         } catch (Exception e) {
116         }
117     }
118
119     @Test
120     public void testGetVersionByInvariantId() throws Exception {
121         AaiController testSubject;
122         HttpServletRequest request = null;
123         VersionByInvariantIdsRequest versions = null;
124         ResponseEntity<String> result;
125
126         // default test
127         try {
128             testSubject = createTestSubject();
129             result = testSubject.getVersionByInvariantId(request, versions);
130         } catch (Exception e) {
131         }
132     }
133
134     // @Test
135     // public void testAaiResponseToResponseEntity() throws Exception {
136     // AaiController testSubject;AaiResponse aaiResponseData = null;
137     // ResponseEntity<String> result;
138     //
139     // // default test
140     // }
141
142     @Test
143     public void testDoGetServiceInstance() throws Exception {
144         AaiController testSubject;
145         String serviceInstanceId = "";
146         String serviceInstanceType = "";
147         ResponseEntity<String> result;
148
149         // default test
150         try {
151             testSubject = createTestSubject();
152             result = testSubject.doGetServiceInstance(serviceInstanceId, serviceInstanceType);
153         } catch (Exception e) {
154         }
155     }
156
157     @Test
158     public void testDoGetServices_1() throws Exception {
159         AaiController testSubject;
160         String globalCustomerId = "";
161         String serviceSubscriptionId = "";
162         ResponseEntity<String> result;
163
164         // default test
165         try {
166             testSubject = createTestSubject();
167             result = testSubject.doGetServices(globalCustomerId, serviceSubscriptionId);
168         } catch (Exception e) {
169         }
170     }
171
172     @Test
173     public void testDoGetSubscriberList() throws Exception {
174         AaiController testSubject;
175         HttpServletRequest request = null;
176         String fullSet = "";
177         ResponseEntity<String> result;
178
179         // default test
180         try {
181             testSubject = createTestSubject();
182             result = testSubject.doGetSubscriberList(request, fullSet);
183         } catch (Exception e) {
184         }
185     }
186
187     @Test
188     public void testGetOperationalEnvironments() throws Exception {
189         AaiController testSubject;
190         String operationalEnvironmentType = "";
191         String operationalEnvironmentStatus = "";
192         AaiResponse<OperationalEnvironmentList> result;
193
194         // default test
195         try {
196             testSubject = createTestSubject();
197             result = testSubject.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
198         } catch (Exception e) {
199         }
200     }
201
202     @Test
203     public void testGetFullSubscriberList() throws Exception {
204         AaiController testSubject;
205         HttpServletRequest request = null;
206         ResponseEntity<String> result;
207
208         // default test
209         try {
210             testSubject = createTestSubject();
211             result = testSubject.getFullSubscriberList(request);
212         } catch (Exception e) {
213         }
214     }
215
216     @Test
217     public void testGetVnfDataByGlobalIdAndServiceType() throws Exception {
218         AaiController testSubject;
219         HttpServletRequest request = null;
220         String globalCustomerId = "";
221         String serviceType = "";
222         ResponseEntity<String> result;
223
224         // default test
225         try {
226             testSubject = createTestSubject();
227             result = testSubject.getVnfDataByGlobalIdAndServiceType(request, globalCustomerId, serviceType);
228         } catch (Exception e) {
229         }
230     }
231
232     @Test
233     public void testDoRefreshSubscriberList() throws Exception {
234         AaiController testSubject;
235         ResponseEntity<String> result;
236
237         // default test
238         try {
239             testSubject = createTestSubject();
240             result = testSubject.doRefreshSubscriberList();
241         } catch (Exception e) {
242         }
243     }
244
245     @Test
246     public void testDoRefreshFullSubscriberList() throws Exception {
247         AaiController testSubject;
248         ResponseEntity<String> result;
249
250         // default test
251         try {
252             testSubject = createTestSubject();
253             result = testSubject.doRefreshFullSubscriberList();
254         } catch (Exception e) {
255         }
256     }
257
258     @Test
259     public void testGetSubscriberDetails() throws Exception {
260         AaiController testSubject;
261         HttpServletRequest request = null;
262         String subscriberId = "";
263         ResponseEntity<String> result;
264
265         // default test
266         try {
267             testSubject = createTestSubject();
268             result = testSubject.GetSubscriberDetails(request, subscriberId);
269         } catch (Exception e) {
270         }
271     }
272
273     @Test
274     public void testSearchServiceInstances() throws Exception {
275         AaiController testSubject;
276         HttpServletRequest request = null;
277         String subscriberId = "";
278         String instanceIdentifier = "";
279         List<String> projects = null;
280         List<String> owningEntities = null;
281         ResponseEntity<String> result;
282
283         // default test
284         try {
285             testSubject = createTestSubject();
286             result = testSubject.SearchServiceInstances(request, subscriberId, instanceIdentifier, projects,
287                     owningEntities);
288         } catch (Exception e) {
289         }
290     }
291
292     @Test
293     public void testViewEditGetComponentList() throws Exception {
294         AaiController testSubject;
295         String namedQueryId = "";
296         String globalCustomerId = "";
297         String serviceType = "";
298         String serviceInstance = "";
299         ResponseEntity<String> result;
300
301         // default test
302         try {
303             testSubject = createTestSubject();
304             result = testSubject.viewEditGetComponentList(namedQueryId, globalCustomerId, serviceType, serviceInstance);
305         } catch (Exception e) {
306         }
307     }
308
309     @Test
310     public void testGetVnfData() throws Exception {
311         AaiController testSubject;
312         String globalCustomerId = "";
313         String serviceType = "";
314         String serviceInstanceId = "";
315         AaiResponse<String> result;
316
317         // default test
318         try {
319             testSubject = createTestSubject();
320             result = testSubject.getVnfData(globalCustomerId, serviceType, serviceInstanceId);
321         } catch (Exception e) {
322         }
323     }
324
325     @Test
326     public void testViewEditGetComponentList_1() throws Exception {
327         AaiController testSubject;
328         String namedQueryId = "";
329         String globalCustomerId = "";
330         String serviceType = "";
331         ResponseEntity<String> result;
332
333         // default test
334         try {
335             testSubject = createTestSubject();
336             result = testSubject.viewEditGetComponentList(namedQueryId, globalCustomerId, serviceType);
337         } catch (Exception e) {
338         }
339     }
340
341     @Test
342     public void testGetNodeTemplateInstances() throws Exception {
343         AaiController testSubject;
344         String globalCustomerId = "";
345         String serviceType = "";
346         String modelVersionId = "";
347         String modelInvariantId = "";
348         String cloudRegion = "";
349         ResponseEntity<String> result;
350
351         // default test
352         try {
353             testSubject = createTestSubject();
354             result = testSubject.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId,
355                     modelInvariantId, cloudRegion);
356         } catch (Exception e) {
357         }
358     }
359
360     @Test
361     public void testGetByUri() throws Exception {
362         AaiController testSubject;
363         HttpServletRequest request = null;
364         ResponseEntity<String> result;
365
366         // default test
367         try {
368             testSubject = createTestSubject();
369             result = testSubject.getByUri(request);
370         } catch (Exception e) {
371         }
372     }
373
374     @Test
375     public void testGetSpecificConfiguration() throws Exception {
376         AaiController testSubject;
377         String configurationId = "";
378         ResponseEntity<String> result;
379
380         // default test
381         try {
382             testSubject = createTestSubject();
383             result = testSubject.getSpecificConfiguration(configurationId);
384         } catch (Exception e) {
385         }
386     }
387
388     @Test
389     public void testGetServiceInstanceAssociatedPnfs() throws Exception {
390         AaiController testSubject;
391         String globalCustomerId = "";
392         String serviceType = "";
393         String serviceInstanceId = "";
394         List<String> result;
395
396         // default test
397         try {
398             testSubject = createTestSubject();
399             result = testSubject.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);
400         } catch (Exception e) {
401         }
402     }
403
404     @Test
405     public void testGetSpecificPnf() throws Exception {
406         AaiController testSubject;
407         String pnfId = "";
408         ResponseEntity result;
409
410         // default test
411         try {
412             testSubject = createTestSubject();
413             result = testSubject.getSpecificPnf(pnfId);
414         } catch (Exception e) {
415         }
416     }
417
418     @Test
419     public void testGetPnfInstances() throws Exception {
420         AaiController testSubject;
421         String globalCustomerId = "";
422         String serviceType = "";
423         String modelVersionId = "";
424         String modelInvariantId = "";
425         String cloudRegion = "";
426         String equipVendor = "";
427         String equipModel = "";
428         ResponseEntity<String> result;
429
430         // default test
431         try {
432             testSubject = createTestSubject();
433             result = testSubject.getPnfInstances(globalCustomerId, serviceType, modelVersionId, modelInvariantId,
434                     cloudRegion, equipVendor, equipModel);
435         } catch (Exception e) {
436         }
437
438     }
439
440 }