1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\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
11 * * http://www.apache.org/licenses/LICENSE-2.0
\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
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package org.onap.aaf.cass;
\r
25 import static org.junit.Assert.*;
\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
35 public class AAFAuthenticatorTest
\r
46 public void tearDown()
\r
52 * Testing Conditon(s): Default
\r
55 public void test_method_requireAuthentication_0_branch_0()
\r
57 System.out.println("Now Testing Method:requireAuthentication Branch:0");
\r
60 AAFAuthenticator instance = new AAFAuthenticator();
\r
62 //Get expected result and result
\r
63 Object expResult = null;
\r
64 Object result = instance.requireAuthentication();
\r
66 //Check Return value
\r
67 assertEquals(expResult, result);
\r
69 //Check Test Verification Points
\r
70 assertEquals(null, instance.requireAuthentication());
\r
75 * Testing Conditon(s): if: (username == null)
\r
78 public void test_method_authenticate_1_branch_0()
\r
80 System.out.println("Now Testing Method:authenticate Branch:0");
\r
87 * Testing Conditon(s): else: Not (username == null)
\r
90 public void test_method_authenticate_1_branch_1() throws AuthenticationException
\r
92 System.out.println("Now Testing Method:authenticate Branch:1");
\r
95 AAFAuthenticator instance = new AAFAuthenticator();
\r
97 //Get expected result and result
\r
98 Object expResult = null;
\r
99 Object result = instance.authenticate(null);
\r
101 //Check Return value
\r
102 assertEquals(expResult, result);
\r
109 * Testing Conditon(s): if: (password == null)
\r
112 public void test_method_authenticate_1_branch_2()
\r
114 System.out.println("Now Testing Method:authenticate Branch:2");
\r
121 * Testing Conditon(s): else: Not (password == null), if: (password.startsWith("bsf:"))
\r
124 public void test_method_authenticate_1_branch_3()
\r
126 System.out.println("Now Testing Method:authenticate Branch:3");
\r
133 * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), if: (password.startsWith("enc:???"))
\r
136 public void test_method_authenticate_1_branch_4()
\r
138 System.out.println("Now Testing Method:authenticate Branch:4");
\r
143 * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), else: Not (password.startsWith("enc:???"))
\r
146 public void test_method_authenticate_1_branch_5()
\r
148 System.out.println("Now Testing Method:authenticate Branch:5");
\r
155 * Testing Conditon(s): if: (localLur!=null), if: (localLur.validate(fullName, Type.PASSWORD, password.getBytes()))
\r
158 public void test_method_authenticate_1_branch_6()
\r
160 System.out.println("Now Testing Method:authenticate Branch:6");
\r
167 * Testing Conditon(s): if: (localLur!=null), else: Not (localLur.validate(fullName, Type.PASSWORD, password.getBytes()))
\r
170 public void test_method_authenticate_1_branch_7()
\r
172 System.out.println("Now Testing Method:authenticate Branch:7");
\r
178 * Testing Conditon(s): else: Not (localLur!=null)
\r
181 public void test_method_authenticate_1_branch_8()
\r
183 System.out.println("Now Testing Method:authenticate Branch:8");
\r
190 * Testing Conditon(s): if: (aafResponse != null)
\r
193 public void test_method_authenticate_1_branch_9()
\r
195 System.out.println("Now Testing Method:authenticate Branch:9");
\r
201 * Testing Conditon(s): else: Not (aafResponse != null)
\r
204 public void test_method_authenticate_1_branch_10()
\r
206 System.out.println("Now Testing Method:authenticate Branch:10");
\r
213 * Testing Conditon(s): Default
\r
216 public void test_method_create_2_branch_0()
\r
218 System.out.println("Now Testing Method:create Branch:0");
\r
225 * Testing Conditon(s): Default
\r
228 public void test_method_alter_3_branch_0()
\r
230 System.out.println("Now Testing Method:alter Branch:0");
\r
236 * Testing Conditon(s): Default
\r
239 public void test_method_drop_4_branch_0()
\r
241 System.out.println("Now Testing Method:drop Branch:0");
\r
247 * Testing Conditon(s): Default
\r
250 public void test_method_evaluateResponse_5_branch_0()
\r
252 System.out.println("Now Testing Method:evaluateResponse Branch:0");
\r
258 * Testing Conditon(s): Default
\r
261 public void test_method_isComplete_6_branch_0()
\r
263 System.out.println("Now Testing Method:isComplete Branch:0");
\r
269 * Testing Conditon(s): Default
\r
272 public void test_method_getAuthenticatedUser_7_branch_0()
\r
274 System.out.println("Now Testing Method:getAuthenticatedUser Branch:0");
\r
281 * Testing Conditon(s): Default
\r
284 public void test_method_newAuthenticator_8_branch_0()
\r
286 System.out.println("Now Testing Method:newAuthenticator Branch:0");
\r