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.dao;
\r
25 import static org.junit.Assert.*;
\r
27 import java.io.IOException;
\r
28 import java.util.ArrayList;
\r
29 import java.util.List;
\r
31 import org.junit.Before;
\r
32 import org.junit.Test;
\r
33 import org.junit.runner.RunWith;
\r
34 import org.mockito.Mock;
\r
35 import org.onap.aaf.dao.CassAccess;
\r
36 import org.powermock.modules.junit4.PowerMockRunner;
\r
38 import org.onap.aaf.inno.env.APIException;
\r
39 import org.onap.aaf.inno.env.Env;
\r
40 //import org.onap.aaf.dao.CassAccess.Resettable;
\r
41 import com.datastax.driver.core.Cluster.Builder;
\r
43 @RunWith(PowerMockRunner.class)
\r
44 public class JU_CassAccess {
\r
45 CassAccess cassAccess;
\r
47 public static final String KEYSPACE = "authz";
\r
48 public static final String CASSANDRA_CLUSTERS = "cassandra.clusters";
\r
49 public static final String CASSANDRA_CLUSTERS_PORT = "cassandra.clusters.port";
\r
50 public static final String CASSANDRA_CLUSTERS_USER_NAME = "cassandra.clusters.user";
\r
51 public static final String CASSANDRA_CLUSTERS_PASSWORD = "cassandra.clusters.password";
\r
52 public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions";
\r
53 public static final String LATITUDE = "LATITUDE";
\r
54 public static final String LONGITUDE = "LONGITUDE";
\r
55 //private static final List<Resettable> resetExceptions = new ArrayList<Resettable>();
\r
56 public static final String ERR_ACCESS_MSG = "Accessing Backend";
\r
57 private static Builder cb = null;
\r
63 public void setUp(){
\r
64 cassAccess = new CassAccess();
\r
68 @Test(expected=APIException.class)
\r
69 public void testCluster() throws APIException, IOException {
\r
70 cassAccess.cluster(envMock, prefix);
\r