Unit tests
[vid.git] / vid-app-common / src / test / java / org / onap / vid / services / AaiServiceImplTest.java
1 package org.onap.vid.services;
2
3 import java.util.Collection;
4 import java.util.List;
5
6 import org.junit.Assert;
7 import org.junit.Test;
8 import org.onap.vid.aai.AaiResponse;
9 import org.onap.vid.aai.SubscriberFilteredResults;
10 import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
11 import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
12 import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
13 import org.onap.vid.model.SubscriberList;
14 import org.onap.vid.roles.RoleValidator;
15
16 public class AaiServiceImplTest {
17
18     private AaiServiceImpl createTestSubject() {
19         return new AaiServiceImpl();
20     }
21
22     @Test
23     public void testGetFullSubscriberList() throws Exception {
24         AaiServiceImpl testSubject;
25         RoleValidator roleValidator = null;
26         SubscriberFilteredResults result;
27
28         // default test
29         try {
30             testSubject = createTestSubject();
31             result = testSubject.getFullSubscriberList(roleValidator);
32         } catch (
33
34         Exception e) {
35         }
36     }
37
38     @Test
39     public void testGetOperationalEnvironments() throws Exception {
40         AaiServiceImpl testSubject;
41         String operationalEnvironmentType = "";
42         String operationalEnvironmentStatus = "";
43         AaiResponse<OperationalEnvironmentList> result;
44
45         // default test
46         try {
47             testSubject = createTestSubject();
48             result = testSubject.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
49         } catch (
50
51         Exception e) {
52         }
53     }
54
55     @Test
56     public void testGetFullSubscriberList_1() throws Exception {
57         AaiServiceImpl testSubject;
58         AaiResponse<SubscriberList> result;
59
60         // default test
61         try {
62             testSubject = createTestSubject();
63             result = testSubject.getFullSubscriberList();
64         } catch (
65
66         Exception e) {
67         }
68     }
69
70     @Test
71     public void testGetSubscriberData() throws Exception {
72         AaiServiceImpl testSubject;
73         String subscriberId = "";
74         RoleValidator roleValidator = null;
75         AaiResponse result;
76
77         // default test
78         try {
79             testSubject = createTestSubject();
80             result = testSubject.getSubscriberData(subscriberId, roleValidator);
81         } catch (
82
83         Exception e) {
84         }
85     }
86
87     @Test
88     public void testGetServiceInstanceSearchResults() throws Exception {
89         AaiServiceImpl testSubject;
90         String subscriberId = "";
91         String instanceIdentifier = "";
92         RoleValidator roleValidator = null;
93         List<String> owningEntities = null;
94         List<String> projects = null;
95         AaiResponse result;
96
97         // test 1
98         testSubject = createTestSubject();
99         subscriberId = null;
100         instanceIdentifier = null;
101         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
102                 owningEntities, projects);
103         Assert.assertNotEquals(null, result);
104
105         /*/ test 2
106         testSubject = createTestSubject();
107         subscriberId = "";
108         instanceIdentifier = null;
109         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
110                 owningEntities, projects);
111         Assert.assertNotEquals(null, result);
112
113         // test 3
114         testSubject = createTestSubject();
115         instanceIdentifier = null;
116         subscriberId = null;
117         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
118                 owningEntities, projects);
119         Assert.assertEquals(null, result);
120
121         // test 4
122         testSubject = createTestSubject();
123         instanceIdentifier = "";
124         subscriberId = null;
125         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
126                 owningEntities, projects);
127         Assert.assertEquals(null, result);
128
129         // test 5
130         testSubject = createTestSubject();
131         owningEntities = null;
132         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
133                 owningEntities, projects);
134         Assert.assertEquals(null, result);
135
136         // test 6
137         testSubject = createTestSubject();
138         projects = null;
139         result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
140                 owningEntities, projects);
141         Assert.assertEquals(null, result);*/
142     }
143
144     @Test
145     public void testGetVersionByInvariantId() throws Exception {
146         AaiServiceImpl testSubject;
147         List<String> modelInvariantId = null;
148
149         // default test
150         try {
151             testSubject = createTestSubject();
152             testSubject.getVersionByInvariantId(modelInvariantId);
153         } catch (
154
155         Exception e) {
156         }
157     }
158
159     @Test
160     public void testGetSpecificPnf() throws Exception {
161         AaiServiceImpl testSubject;
162         String pnfId = "";
163         AaiResponse<Pnf> result;
164
165         // default test
166         try {
167             testSubject = createTestSubject();
168             result = testSubject.getSpecificPnf(pnfId);
169         } catch (
170
171         Exception e) {
172         }
173     }
174
175     @Test
176     public void testGetPNFData() throws Exception {
177         AaiServiceImpl testSubject;
178         String globalCustomerId = "";
179         String serviceType = "";
180         String modelVersionId = "";
181         String modelInvariantId = "";
182         String cloudRegion = "";
183         String equipVendor = "";
184         String equipModel = "";
185         AaiResponse result;
186
187         // default test
188         try {
189             testSubject = createTestSubject();
190             result = testSubject.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId,
191                     cloudRegion, equipVendor, equipModel);
192         } catch (
193
194         Exception e) {
195         }
196     }
197
198     @Test
199     public void testGetServices() throws Exception {
200         AaiServiceImpl testSubject;
201         RoleValidator roleValidator = null;
202         AaiResponse result;
203
204         // default test
205         try {
206             testSubject = createTestSubject();
207             result = testSubject.getServices(roleValidator);
208         } catch (
209
210         Exception e) {
211         }
212     }
213
214     @Test
215     public void testGetTenants() throws Exception {
216         AaiServiceImpl testSubject;
217         String globalCustomerId = "";
218         String serviceType = "";
219         RoleValidator roleValidator = null;
220         AaiResponse<GetTenantsResponse[]> result;
221
222         // default test
223         try {
224             testSubject = createTestSubject();
225             result = testSubject.getTenants(globalCustomerId, serviceType, roleValidator);
226         } catch (
227
228         Exception e) {
229         }
230     }
231
232     @Test
233     public void testGetVNFData() throws Exception {
234         AaiServiceImpl testSubject;
235         String globalSubscriberId = "";
236         String serviceType = "";
237         String serviceInstanceId = "";
238         AaiResponse result;
239
240         // default test
241         try {
242             testSubject = createTestSubject();
243             result = testSubject.getVNFData(globalSubscriberId, serviceType, serviceInstanceId);
244         } catch (
245
246         Exception e) {
247         }
248     }
249
250     @Test
251     public void testGetVNFData_1() throws Exception {
252         AaiServiceImpl testSubject;
253         String globalSubscriberId = "";
254         String serviceType = "";
255
256         // default test
257         try {
258             testSubject = createTestSubject();
259             testSubject.getVNFData(globalSubscriberId, serviceType);
260         } catch (
261
262         Exception e) {
263         }
264     }
265
266     @Test
267     public void testGetAaiZones() throws Exception {
268         AaiServiceImpl testSubject;
269         AaiResponse result;
270
271         // default test
272         try {
273             testSubject = createTestSubject();
274             result = testSubject.getAaiZones();
275         } catch (
276
277         Exception e) {
278         }
279     }
280
281     @Test
282     public void testGetAicZoneForPnf() throws Exception {
283         AaiServiceImpl testSubject;
284         String globalCustomerId = "";
285         String serviceType = "";
286         String serviceId = "";
287         AaiResponse result;
288
289         // default test
290         try {
291             testSubject = createTestSubject();
292             result = testSubject.getAicZoneForPnf(globalCustomerId, serviceType, serviceId);
293         } catch (
294
295         Exception e) {
296         }
297     }
298
299     @Test
300     public void testGetNodeTemplateInstances() throws Exception {
301         AaiServiceImpl testSubject;
302         String globalCustomerId = "";
303         String serviceType = "";
304         String modelVersionId = "";
305         String modelInvariantId = "";
306         String cloudRegion = "";
307         AaiResponse result;
308
309         // default test
310         try {
311             testSubject = createTestSubject();
312             result = testSubject.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId,
313                     modelInvariantId, cloudRegion);
314         } catch (
315
316         Exception e) {
317         }
318     }
319
320     @Test
321     public void testGetServicesByDistributionStatus() throws Exception {
322         AaiServiceImpl testSubject;
323
324         // default test
325         try {
326             testSubject = createTestSubject();
327             testSubject.getServicesByDistributionStatus();
328         } catch (
329
330         Exception e) {
331         }
332     }
333
334     @Test
335     public void testGetServiceInstanceAssociatedPnfs() throws Exception {
336         AaiServiceImpl testSubject;
337         String globalCustomerId = "";
338         String serviceType = "";
339         String serviceInstanceId = "";
340         List<String> result;
341
342         // default test
343         try {
344             testSubject = createTestSubject();
345             result = testSubject.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);
346         } catch (
347
348         Exception e) {
349         }
350     }
351 }