1 package org.onap.vid.services;
3 import java.util.Collection;
6 import org.junit.Assert;
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;
16 public class AaiServiceImplTest {
18 private AaiServiceImpl createTestSubject() {
19 return new AaiServiceImpl();
23 public void testGetFullSubscriberList() throws Exception {
24 AaiServiceImpl testSubject;
25 RoleValidator roleValidator = null;
26 SubscriberFilteredResults result;
30 testSubject = createTestSubject();
31 result = testSubject.getFullSubscriberList(roleValidator);
39 public void testGetOperationalEnvironments() throws Exception {
40 AaiServiceImpl testSubject;
41 String operationalEnvironmentType = "";
42 String operationalEnvironmentStatus = "";
43 AaiResponse<OperationalEnvironmentList> result;
47 testSubject = createTestSubject();
48 result = testSubject.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
56 public void testGetFullSubscriberList_1() throws Exception {
57 AaiServiceImpl testSubject;
58 AaiResponse<SubscriberList> result;
62 testSubject = createTestSubject();
63 result = testSubject.getFullSubscriberList();
71 public void testGetSubscriberData() throws Exception {
72 AaiServiceImpl testSubject;
73 String subscriberId = "";
74 RoleValidator roleValidator = null;
79 testSubject = createTestSubject();
80 result = testSubject.getSubscriberData(subscriberId, roleValidator);
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;
98 testSubject = createTestSubject();
100 instanceIdentifier = null;
101 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
102 owningEntities, projects);
103 Assert.assertNotEquals(null, result);
106 testSubject = createTestSubject();
108 instanceIdentifier = null;
109 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
110 owningEntities, projects);
111 Assert.assertNotEquals(null, result);
114 testSubject = createTestSubject();
115 instanceIdentifier = null;
117 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
118 owningEntities, projects);
119 Assert.assertEquals(null, result);
122 testSubject = createTestSubject();
123 instanceIdentifier = "";
125 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
126 owningEntities, projects);
127 Assert.assertEquals(null, result);
130 testSubject = createTestSubject();
131 owningEntities = null;
132 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
133 owningEntities, projects);
134 Assert.assertEquals(null, result);
137 testSubject = createTestSubject();
139 result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
140 owningEntities, projects);
141 Assert.assertEquals(null, result);*/
145 public void testGetVersionByInvariantId() throws Exception {
146 AaiServiceImpl testSubject;
147 List<String> modelInvariantId = null;
151 testSubject = createTestSubject();
152 testSubject.getVersionByInvariantId(modelInvariantId);
160 public void testGetSpecificPnf() throws Exception {
161 AaiServiceImpl testSubject;
163 AaiResponse<Pnf> result;
167 testSubject = createTestSubject();
168 result = testSubject.getSpecificPnf(pnfId);
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 = "";
189 testSubject = createTestSubject();
190 result = testSubject.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId,
191 cloudRegion, equipVendor, equipModel);
199 public void testGetServices() throws Exception {
200 AaiServiceImpl testSubject;
201 RoleValidator roleValidator = null;
206 testSubject = createTestSubject();
207 result = testSubject.getServices(roleValidator);
215 public void testGetTenants() throws Exception {
216 AaiServiceImpl testSubject;
217 String globalCustomerId = "";
218 String serviceType = "";
219 RoleValidator roleValidator = null;
220 AaiResponse<GetTenantsResponse[]> result;
224 testSubject = createTestSubject();
225 result = testSubject.getTenants(globalCustomerId, serviceType, roleValidator);
233 public void testGetVNFData() throws Exception {
234 AaiServiceImpl testSubject;
235 String globalSubscriberId = "";
236 String serviceType = "";
237 String serviceInstanceId = "";
242 testSubject = createTestSubject();
243 result = testSubject.getVNFData(globalSubscriberId, serviceType, serviceInstanceId);
251 public void testGetVNFData_1() throws Exception {
252 AaiServiceImpl testSubject;
253 String globalSubscriberId = "";
254 String serviceType = "";
258 testSubject = createTestSubject();
259 testSubject.getVNFData(globalSubscriberId, serviceType);
267 public void testGetAaiZones() throws Exception {
268 AaiServiceImpl testSubject;
273 testSubject = createTestSubject();
274 result = testSubject.getAaiZones();
282 public void testGetAicZoneForPnf() throws Exception {
283 AaiServiceImpl testSubject;
284 String globalCustomerId = "";
285 String serviceType = "";
286 String serviceId = "";
291 testSubject = createTestSubject();
292 result = testSubject.getAicZoneForPnf(globalCustomerId, serviceType, serviceId);
300 public void testGetNodeTemplateInstances() throws Exception {
301 AaiServiceImpl testSubject;
302 String globalCustomerId = "";
303 String serviceType = "";
304 String modelVersionId = "";
305 String modelInvariantId = "";
306 String cloudRegion = "";
311 testSubject = createTestSubject();
312 result = testSubject.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId,
313 modelInvariantId, cloudRegion);
321 public void testGetServicesByDistributionStatus() throws Exception {
322 AaiServiceImpl testSubject;
326 testSubject = createTestSubject();
327 testSubject.getServicesByDistributionStatus();
335 public void testGetServiceInstanceAssociatedPnfs() throws Exception {
336 AaiServiceImpl testSubject;
337 String globalCustomerId = "";
338 String serviceType = "";
339 String serviceInstanceId = "";
344 testSubject = createTestSubject();
345 result = testSubject.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);