Improve code coverage for aaf cadi modules
[aaf/cadi.git] / cass / src / test / java / org / onap / aaf / cadi / aaf / cass / AAFAuthenticatorTest.java
1 /*******************************************************************************\r
2  * ============LICENSE_START====================================================\r
3  * * org.onap.aaf\r
4  * * ===========================================================================\r
5  * * Copyright © 2017 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  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
21  * *\r
22  ******************************************************************************/\r
23 package org.onap.aaf.cadi.aaf.cass;\r
24 \r
25 import static org.junit.Assert.*;\r
26 \r
27 import org.apache.cassandra.exceptions.AuthenticationException;\r
28 import org.junit.Test;\r
29 import org.onap.aaf.cadi.aaf.cass.AAFAuthenticator;\r
30 import org.junit.After;\r
31 import org.junit.Before;\r
32 import org.junit.Test;\r
33 import static org.junit.Assert.*;\r
34 \r
35 public class AAFAuthenticatorTest\r
36 {\r
37         \r
38 \r
39         @Before\r
40         public void setUp()\r
41         {\r
42                 \r
43         }\r
44 \r
45         @After\r
46         public void tearDown()\r
47         {\r
48                 \r
49         }\r
50 \r
51         /*\r
52          * Testing Conditon(s): Default\r
53          */\r
54         @Test\r
55         public void test_method_requireAuthentication_0_branch_0()\r
56         {\r
57                 System.out.println("Now Testing Method:requireAuthentication Branch:0");\r
58                 \r
59                 //Constructor\r
60                 AAFAuthenticator instance = new AAFAuthenticator();\r
61                 \r
62                 //Get expected result and result\r
63                 Object expResult = null;\r
64                 Object result = instance.requireAuthentication();\r
65                 \r
66                 //Check Return value\r
67                 assertEquals(expResult, result);\r
68                 \r
69                 //Check Test Verification Points\r
70                 assertEquals(null, instance.requireAuthentication());\r
71                 \r
72         }\r
73 \r
74         /*\r
75          * Testing Conditon(s): if: (username == null)\r
76          */\r
77         @Test\r
78         public void test_method_authenticate_1_branch_0()\r
79         {\r
80                 System.out.println("Now Testing Method:authenticate Branch:0");\r
81                 \r
82         \r
83                 \r
84         }\r
85 \r
86         /*\r
87          * Testing Conditon(s): else: Not (username == null)\r
88          */\r
89         @Test\r
90         public void test_method_authenticate_1_branch_1() throws AuthenticationException\r
91         {\r
92                 System.out.println("Now Testing Method:authenticate Branch:1");\r
93                 \r
94                 //Constructor\r
95                 AAFAuthenticator instance = new AAFAuthenticator();\r
96                 \r
97                 //Get expected result and result\r
98                 Object expResult = null;\r
99                 Object result = instance.authenticate(null);\r
100                 \r
101                 //Check Return value\r
102                 assertEquals(expResult, result);\r
103                 \r
104         \r
105                 \r
106         }\r
107 \r
108         /*\r
109          * Testing Conditon(s): if: (password == null)\r
110          */\r
111         @Test\r
112         public void test_method_authenticate_1_branch_2()\r
113         {\r
114                 System.out.println("Now Testing Method:authenticate Branch:2");\r
115                 \r
116                 \r
117                 \r
118         }\r
119 \r
120         /*\r
121          * Testing Conditon(s): else: Not (password == null), if: (password.startsWith("bsf:"))\r
122          */\r
123         @Test\r
124         public void test_method_authenticate_1_branch_3()\r
125         {\r
126                 System.out.println("Now Testing Method:authenticate Branch:3");\r
127                 \r
128                 \r
129                 \r
130         }\r
131 \r
132         /*\r
133          * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), if: (password.startsWith("enc:???"))\r
134          */\r
135         @Test\r
136         public void test_method_authenticate_1_branch_4()\r
137         {\r
138                 System.out.println("Now Testing Method:authenticate Branch:4");\r
139         \r
140         }\r
141 \r
142         /*\r
143          * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), else: Not (password.startsWith("enc:???"))\r
144          */\r
145         @Test\r
146         public void test_method_authenticate_1_branch_5()\r
147         {\r
148                 System.out.println("Now Testing Method:authenticate Branch:5");\r
149                 \r
150                 \r
151                 \r
152         }\r
153 \r
154         /*\r
155          * Testing Conditon(s): if: (localLur!=null), if: (localLur.validate(fullName, Type.PASSWORD, password.getBytes()))\r
156          */\r
157         @Test\r
158         public void test_method_authenticate_1_branch_6()\r
159         {\r
160                 System.out.println("Now Testing Method:authenticate Branch:6");\r
161                 \r
162                 \r
163                 \r
164         }\r
165 \r
166         /*\r
167          * Testing Conditon(s): if: (localLur!=null), else: Not (localLur.validate(fullName, Type.PASSWORD, password.getBytes()))\r
168          */\r
169         @Test\r
170         public void test_method_authenticate_1_branch_7()\r
171         {\r
172                 System.out.println("Now Testing Method:authenticate Branch:7");\r
173                 \r
174                 \r
175         }\r
176 \r
177         /*\r
178          * Testing Conditon(s): else: Not (localLur!=null)\r
179          */\r
180         @Test\r
181         public void test_method_authenticate_1_branch_8()\r
182         {\r
183                 System.out.println("Now Testing Method:authenticate Branch:8");\r
184                 \r
185                 \r
186                 \r
187         }\r
188 \r
189         /*\r
190          * Testing Conditon(s): if: (aafResponse != null)\r
191          */\r
192         @Test\r
193         public void test_method_authenticate_1_branch_9()\r
194         {\r
195                 System.out.println("Now Testing Method:authenticate Branch:9");\r
196                 \r
197         \r
198         }\r
199 \r
200         /*\r
201          * Testing Conditon(s): else: Not (aafResponse != null)\r
202          */\r
203         @Test\r
204         public void test_method_authenticate_1_branch_10()\r
205         {\r
206                 System.out.println("Now Testing Method:authenticate Branch:10");\r
207                 \r
208                 \r
209                 \r
210         }\r
211 \r
212         /*\r
213          * Testing Conditon(s): Default\r
214          */\r
215         @Test\r
216         public void test_method_create_2_branch_0()\r
217         {\r
218                 System.out.println("Now Testing Method:create Branch:0");\r
219                 \r
220                 \r
221                 \r
222         }\r
223 \r
224         /*\r
225          * Testing Conditon(s): Default\r
226          */\r
227         @Test\r
228         public void test_method_alter_3_branch_0()\r
229         {\r
230                 System.out.println("Now Testing Method:alter Branch:0");\r
231                 \r
232                 \r
233         }\r
234 \r
235         /*\r
236          * Testing Conditon(s): Default\r
237          */\r
238         @Test\r
239         public void test_method_drop_4_branch_0()\r
240         {\r
241                 System.out.println("Now Testing Method:drop Branch:0");\r
242                 \r
243                 \r
244         }\r
245 \r
246         /*\r
247          * Testing Conditon(s): Default\r
248          */\r
249         @Test\r
250         public void test_method_evaluateResponse_5_branch_0()\r
251         {\r
252                 System.out.println("Now Testing Method:evaluateResponse Branch:0");\r
253                 \r
254                 \r
255         }\r
256 \r
257         /*\r
258          * Testing Conditon(s): Default\r
259          */\r
260         @Test\r
261         public void test_method_isComplete_6_branch_0()\r
262         {\r
263                 System.out.println("Now Testing Method:isComplete Branch:0");\r
264                 \r
265         \r
266         }\r
267 \r
268         /*\r
269          * Testing Conditon(s): Default\r
270          */\r
271         @Test\r
272         public void test_method_getAuthenticatedUser_7_branch_0()\r
273         {\r
274                 System.out.println("Now Testing Method:getAuthenticatedUser Branch:0");\r
275                 \r
276                 \r
277                 \r
278         }\r
279 \r
280         /*\r
281          * Testing Conditon(s): Default\r
282          */\r
283         @Test\r
284         public void test_method_newAuthenticator_8_branch_0()\r
285         {\r
286                 System.out.println("Now Testing Method:newAuthenticator Branch:0");\r
287                 \r
288                 \r
289                 \r
290         }\r
291 \r
292 }\r