93b872cc4b27613b534cbd57755d91dc945bde41
[so.git] /
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.network;\r
22 \r
23 import java.util.ArrayList;\r
24 \r
25 import org.junit.Test;\r
26 import org.openecomp.mso.entity.MsoRequest;\r
27 import org.openecomp.mso.openstack.beans.NetworkRollback;\r
28 \r
29 public class MsoNetworkAdapterAsyncImplTest {\r
30 \r
31         @Test\r
32         public void healthCheckATest() {\r
33                 MsoNetworkAdapterAsyncImpl mNAAimpl = new MsoNetworkAdapterAsyncImpl();\r
34                 mNAAimpl.healthCheckA();\r
35         }\r
36 \r
37         @Test\r
38         public void rollbackNetworkATest() {\r
39                 NetworkRollback nrb = new NetworkRollback();\r
40                 nrb.setCloudId("cloudId");\r
41                 nrb.setMsoRequest(new MsoRequest());\r
42                 nrb.setModelCustomizationUuid("modelCustomizationUuid");\r
43                 nrb.setNetworkCreated(true);\r
44                 nrb.setNetworkId("networkId");\r
45                 nrb.setNetworkName("networkName");\r
46                 nrb.setNetworkStackId("networkStackId");\r
47                 nrb.setNetworkType("networkType");\r
48                 nrb.setNeutronNetworkId("neutronNetworkId");\r
49                 nrb.setPhysicalNetwork("physicalNetwork");\r
50                 nrb.setTenantId("tenantId");\r
51                 nrb.setVlans(new ArrayList<>());\r
52 \r
53                 MsoNetworkAdapterAsyncImpl impl = new MsoNetworkAdapterAsyncImpl();\r
54                 impl.rollbackNetworkA(nrb, "messageId", "/notificationUrl");\r
55         }\r
56 \r
57         @Test\r
58         public void deleteNetworkATest() {\r
59                 MsoNetworkAdapterAsyncImpl impl = new MsoNetworkAdapterAsyncImpl();\r
60                 impl.deleteNetworkA("cloudSiteId", "tenantId", "networkType", "modelCustomizationUuid", "networkId",\r
61                                 "messageId", new MsoRequest(), "/notificationUrl");\r
62         }\r
63 \r
64         @Test\r
65         public void updateNetworkATest() {\r
66                 MsoNetworkAdapterAsyncImpl impl = new MsoNetworkAdapterAsyncImpl();\r
67                 impl.updateNetworkA("cloudSiteId", "tenantId", "networkType", "modelCustomizationUuid", "networkId",\r
68                                 "networkName", "physicalNetworkName", new ArrayList<>(), new ArrayList<>(), "messageId",\r
69                                 new MsoRequest(), "/notificationUrl");\r
70         }\r
71 \r
72         @Test\r
73         public void queryNetworkATest() {\r
74                 MsoNetworkAdapterAsyncImpl impl = new MsoNetworkAdapterAsyncImpl();\r
75                 impl.queryNetworkA("cloudSiteId", "tenantId", "networkNameOrId", "messageId", new MsoRequest(),\r
76                                 "/notificationUrl");\r
77         }\r
78 \r
79         @Test\r
80         public void createNetworkATest() {\r
81                 MsoNetworkAdapterAsyncImpl impl = new MsoNetworkAdapterAsyncImpl();\r
82                 impl.createNetworkA("cloudSiteId", "tenantId", "networkType", "modelCustomizationUuid", "networkName",\r
83                                 "physicalNetworkName", new ArrayList<>(), false, false, new ArrayList<>(), "messageId",\r
84                                 new MsoRequest(), "/notificationUrl");\r
85         }\r
86 }\r