Code coverage for SO adapters
[so.git] / adapters / mso-network-adapter / src / test / java / org / openecomp / mso / adapters / network / NetworkBeansTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 Huawei 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.network;\r
22 \r
23 import java.util.ArrayList;\r
24 \r
25 import org.junit.Test;\r
26 import org.openecomp.mso.openstack.beans.Pool;\r
27 import org.openecomp.mso.openstack.beans.Subnet;\r
28 \r
29 public class NetworkBeansTest {\r
30 \r
31         /**\r
32          * Test case for coverage\r
33          */\r
34         @Test()\r
35         public final void bpelRestClientPOJOTest() {\r
36                 try {\r
37                         BpelRestClient bpelRestClient = new BpelRestClient();\r
38                         bpelRestClient.setConnectTimeout(180);\r
39                         bpelRestClient.setCredentials("credentials");\r
40                         bpelRestClient.setRetryCount(-1);\r
41                         bpelRestClient.setRetryInterval(2);\r
42                         bpelRestClient.setSocketTimeout(10);\r
43                         bpelRestClient.equals(bpelRestClient);\r
44                         bpelRestClient.bpelPost("toBpelStr", "bpelUrl", true);\r
45                         bpelRestClient.getConnectTimeout();\r
46                         bpelRestClient.getCredentials();\r
47                         bpelRestClient.getLastResponse();\r
48                         bpelRestClient.getLastResponseCode();\r
49                         bpelRestClient.getRetryCount();\r
50                         bpelRestClient.getRetryInterval();\r
51                         bpelRestClient.getRetryList();\r
52                         bpelRestClient.getSocketTimeout();\r
53                         bpelRestClient.hashCode();\r
54                         bpelRestClient.toString();\r
55 \r
56                         ContrailPolicyRef contrailPolicyRef = new ContrailPolicyRef();\r
57                         contrailPolicyRef.populate("major", "minor");\r
58                         contrailPolicyRef.toJsonNode();\r
59                         contrailPolicyRef.toJsonString();\r
60                         contrailPolicyRef.toString();\r
61 \r
62                         ContrailPolicyRefSeq contrailPolicyRefSeq = new ContrailPolicyRefSeq();\r
63                         ContrailPolicyRefSeq contrailPolicyRefSeq2 = new ContrailPolicyRefSeq("", "");\r
64                         contrailPolicyRefSeq.setMajor("major");\r
65                         contrailPolicyRefSeq.setMinor("minor");\r
66                         contrailPolicyRefSeq.getMajor();\r
67                         contrailPolicyRefSeq.getMinor();\r
68                         contrailPolicyRefSeq.toString();\r
69 \r
70                         ContrailSubnet contrailSubnet = new ContrailSubnet();\r
71                         contrailSubnet.setAddrFromStart(true);\r
72                         contrailSubnet.setDefaultGateway("defaultGateway");\r
73                         contrailSubnet.setEnableDhcp(true);\r
74                         contrailSubnet.setPools(new ArrayList<ContrailSubnetPool>());\r
75                         contrailSubnet.setSubnet(new ContrailSubnetIp());\r
76                         contrailSubnet.setSubnetName("subnetName");\r
77                         contrailSubnet.getAllocationPools();\r
78                         contrailSubnet.getDefaultGateway();\r
79                         contrailSubnet.getSubnet();\r
80                         contrailSubnet.getSubnetName();\r
81                         contrailSubnet.isAddrFromStart();\r
82                         contrailSubnet.isEnableDhcp();\r
83                         contrailSubnet.populateWith(new Subnet());\r
84                         contrailSubnet.toJsonNode();\r
85                         contrailSubnet.toJsonString();\r
86                         contrailSubnet.toString();\r
87 \r
88                         ContrailSubnetIp contrailSubnetIp = new ContrailSubnetIp();\r
89                         contrailSubnetIp.setIpPrefix("ipPrefix");\r
90                         contrailSubnetIp.setIpPrefixLen("ipPrefixLen");\r
91                         contrailSubnetIp.getIpPrefix();\r
92                         contrailSubnetIp.getIpPrefixLen();\r
93                         contrailSubnetIp.toString();\r
94 \r
95                         ContrailSubnetPool contrailSubnetPool = new ContrailSubnetPool();\r
96                         contrailSubnetPool.setEnd("end");\r
97                         contrailSubnetPool.setStart("start");\r
98                         contrailSubnetPool.getEnd();\r
99                         contrailSubnetPool.getStart();\r
100                         contrailSubnetPool.populateWith(new Pool());\r
101                         contrailSubnetPool.toString();\r
102 \r
103                         // HealthCheckHandler healthCheckHandler = new HealthCheckHandler();\r
104                         // healthCheckHandler.healthcheck("60c3e96e-0970-4871-b6e0-3b6de7561519");\r
105                         // healthCheckHandler.healthcheck("requestId");\r
106                 } catch (Exception e) {\r
107                         assert (false);\r
108 \r
109                 }\r
110         }\r
111 }\r