b9c55a28eddf9de17d1af64e067c5a34eaab5149
[aaf/authz.git] / authz-cass / src / test / java / com / att / dao / JU_CassAccess.java
1 /*******************************************************************************\r
2  * ============LICENSE_START====================================================\r
3  * * org.onap.aai\r
4  * * ===========================================================================\r
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * * Copyright © 2017 Amdocs\r
7  * * ===========================================================================\r
8  * * Licensed under the Apache License, Version 2.0 (the "License");\r
9  * * you may not use this file except in compliance with the License.\r
10  * * You may obtain a copy of the License at\r
11  * * \r
12  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
13  * * \r
14  *  * Unless required by applicable law or agreed to in writing, software\r
15  * * distributed under the License is distributed on an "AS IS" BASIS,\r
16  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17  * * See the License for the specific language governing permissions and\r
18  * * limitations under the License.\r
19  * * ============LICENSE_END====================================================\r
20  * *\r
21  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
22  * *\r
23  ******************************************************************************/\r
24 package com.att.dao;\r
25 \r
26 import static org.junit.Assert.*;\r
27 \r
28 import java.io.IOException;\r
29 import java.util.ArrayList;\r
30 import java.util.List;\r
31 \r
32 import org.junit.Before;\r
33 import org.junit.Test;\r
34 import org.junit.runner.RunWith;\r
35 import org.mockito.Mock;\r
36 import org.powermock.modules.junit4.PowerMockRunner;\r
37 \r
38 import com.att.inno.env.APIException;\r
39 import com.att.inno.env.Env;\r
40 //import com.att.dao.CassAccess.Resettable;\r
41 import com.datastax.driver.core.Cluster.Builder;\r
42 \r
43 @RunWith(PowerMockRunner.class)\r
44 public class JU_CassAccess {\r
45         CassAccess cassAccess;\r
46         \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
58         @Mock\r
59         Env envMock;\r
60         String prefix=null;\r
61         \r
62         @Before\r
63         public void setUp(){\r
64                 cassAccess = new CassAccess();\r
65         }\r
66 \r
67 \r
68         @Test(expected=APIException.class)\r
69         public void testCluster() throws APIException, IOException {\r
70                 cassAccess.cluster(envMock, prefix);\r
71                 \r
72         }\r
73 \r
74 }\r