package correction for vnfadater
[so.git] / adapters / mso-vnf-adapter / src / test / java / org / openecomp / mso / adapters / vnf / MsoVnfAdapterImplTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.mso.adapters.vnf;\r
22 \r
23 import java.util.HashMap;\r
24 import java.util.Map;\r
25 import javax.xml.ws.Holder;\r
26 import org.junit.Test;\r
27 import org.openecomp.mso.adapters.vnf.MsoVnfAdapterImpl;\r
28 import org.openecomp.mso.entity.MsoRequest;\r
29 import org.openecomp.mso.openstack.beans.VnfRollback;\r
30 \r
31 public class MsoVnfAdapterImplTest {\r
32 \r
33         @Test\r
34         public void healthCheckVNFTest() {\r
35                 MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();\r
36                 instance.healthCheck();\r
37         }\r
38 \r
39         @Test\r
40         public void createVnfTest() {\r
41                 MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();\r
42                 MsoRequest msoRequest = new MsoRequest();\r
43                 msoRequest.setRequestId("12345");\r
44                 msoRequest.setServiceInstanceId("12345");\r
45 \r
46                 Map<String, String> map = new HashMap<>();\r
47                 map.put("key1", "value1");\r
48                 try {\r
49                         instance.createVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",\r
50                                         "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,\r
51                                         Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<>(),\r
52                 new Holder<>());\r
53                 } catch (Exception e) {\r
54 \r
55                 }\r
56         }\r
57 \r
58         @Test\r
59         public void updateVnfTest() {\r
60                 MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();\r
61                 MsoRequest msoRequest = new MsoRequest();\r
62                 msoRequest.setRequestId("12345");\r
63                 msoRequest.setServiceInstanceId("12345");\r
64 \r
65                 Map<String, String> map = new HashMap<>();\r
66                 map.put("key1", "value1");\r
67                 try {\r
68                         instance.updateVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",\r
69                                         "volumeGroupHeatStackId|1", "baseVfHeatStackId", "vfModuleStackId",\r
70                                         "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<>(),\r
71                 new Holder<>());\r
72                 } catch (Exception e) {\r
73 \r
74                 }\r
75         }\r
76 \r
77         @Test\r
78         public void deleteVnfTest() {\r
79                 MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();\r
80                 MsoRequest msoRequest = new MsoRequest();\r
81                 msoRequest.setRequestId("12345");\r
82                 msoRequest.setServiceInstanceId("12345");\r
83                 try {\r
84                         instance.deleteVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,\r
85                 new Holder<>());\r
86                 } catch (Exception e) {\r
87 \r
88                 }\r
89         }\r
90 \r
91 }\r