AT&T 2.0.19 Code drop, stage 4
[aaf/authz.git] / authz-cass / src / test / java / org / onap / aaf / dao / JU_CassAccess.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.dao;\r
24 \r
25 import static org.junit.Assert.*;\r
26 \r
27 import java.io.IOException;\r
28 import java.util.ArrayList;\r
29 import java.util.List;\r
30 \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
37 \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
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