Fixes for sonar critical issues
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / std / test / AutoClientUEBTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * PolicyEngineAPI
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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 package org.onap.policy.std.test;
22
23 import java.util.LinkedList;
24 import java.util.List;
25
26 import org.junit.*;
27 import org.onap.policy.api.NotificationHandler;
28 import org.onap.policy.api.NotificationScheme;
29 import org.onap.policy.std.AutoClientUEB;
30
31 import static org.junit.Assert.*;
32
33 /**
34  * The class <code>AutoClientUEBTest</code> contains tests for the class <code>{@link AutoClientUEB}</code>.
35  *
36  * @generatedBy CodePro at 6/1/16 1:40 PM
37  * @version $Revision: 1.0 $
38  */
39 public class AutoClientUEBTest {
40         /**
41          * Run the AutoClientUEB(String,List<String>) constructor test.
42          *
43          * @throws Exception
44          *
45          * @generatedBy CodePro at 6/1/16 1:40 PM
46          */
47         @Test
48         public void testAutoClientUEB_1()
49                 throws Exception {
50                 String url = "";
51                 String apiKey = "";
52                 String apiSecret = "";
53                 List<String> uebURLList = new LinkedList<String>();
54
55                 AutoClientUEB result = new AutoClientUEB(url, uebURLList, apiKey, apiSecret);
56
57                 // add additional test code here
58                 // An unexpected exception was thrown in user code while executing this test:
59                 //    java.lang.ExceptionInInitializerError
60                 //       at org.apache.log4j.Logger.getLogger(Logger.java:104)
61                 //       at org.onap.policy.std.AutoClientUEB.<clinit>(AutoClientUEB.java:39)
62                 assertNotNull(result);
63         }
64
65         /**
66          * Run the String getNotficationType() method test.
67          *
68          * @throws Exception
69          *
70          * @generatedBy CodePro at 6/1/16 1:40 PM
71          */
72         @Test
73         public void testGetNotficationType_1()
74                 throws Exception {
75
76                 String result = AutoClientUEB.getNotficationType();
77
78                 // add additional test code here
79                 // An unexpected exception was thrown in user code while executing this test:
80                 //    java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
81                 assertNull(result);
82         }
83
84         /**
85          * Run the boolean getStatus() method test.
86          *
87          * @throws Exception
88          *
89          * @generatedBy CodePro at 6/1/16 1:40 PM
90          */
91         @Test
92         public void testGetStatus_1()
93                 throws Exception {
94
95                 boolean result = AutoClientUEB.getStatus();
96
97                 // add additional test code here
98                 // An unexpected exception was thrown in user code while executing this test:
99                 //    java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
100                 assertFalse(result);
101         }
102
103         /**
104          * Run the String getURL() method test.
105          *
106          * @throws Exception
107          *
108          * @generatedBy CodePro at 6/1/16 1:40 PM
109          */
110         @Test
111         public void testGetURL_1()
112                 throws Exception {
113
114                 String result = AutoClientUEB.getURL();
115
116                 // add additional test code here
117                 // An unexpected exception was thrown in user code while executing this test:
118                 //    java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
119                 assertNotNull(result);
120         }
121
122         /**
123          * Run the void setScheme(NotificationScheme) method test.
124          *
125          * @throws Exception
126          *
127          * @generatedBy CodePro at 6/1/16 1:40 PM
128          */
129         @Test
130         public void testSetScheme_1()
131                 throws Exception {
132                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
133
134                 AutoClientUEB.setScheme(scheme);
135
136                 // add additional test code here
137                 // An unexpected exception was thrown in user code while executing this test:
138                 //    java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
139         }
140
141         /**
142          * Perform pre-test initialization.
143          *
144          * @throws Exception
145          *         if the initialization fails for some reason
146          *
147          * @generatedBy CodePro at 6/1/16 1:40 PM
148          */
149         @Before
150         public void setUp()
151                 throws Exception {
152                 // add set up code here
153                 List<String> urlList = new LinkedList<String>();
154                 urlList.add("test2.com");
155                 @SuppressWarnings("unused")
156         AutoClientUEB client = new AutoClientUEB("test.com", urlList, "testKey", "testSecret");
157                 NotificationHandler handler = null;
158                 AutoClientUEB.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
159         }
160
161         /**
162          * Perform post-test clean-up.
163          *
164          * @throws Exception
165          *         if the clean-up fails for some reason
166          *
167          * @generatedBy CodePro at 6/1/16 1:40 PM
168          */
169         @After
170         public void tearDown()
171                 throws Exception {
172                 // Add additional tear down code here
173         }
174
175         /**
176          * Launch the test.
177          *
178          * @param args the command line arguments
179          *
180          * @generatedBy CodePro at 6/1/16 1:40 PM
181          */
182         public static void main(String[] args) {
183                 new org.junit.runner.JUnitCore().run(AutoClientUEBTest.class);
184         }
185 }