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