Add Certs, Docker Build
[aaf/authz.git] / cadi / cass / src / test / java / org / onap / aaf / cadi / cass / JU_CASS.java
1 /*******************************************************************************
2  * ============LICENSE_START====================================================
3  * * org.onap.aaf
4  * * ===========================================================================
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * * ===========================================================================
7  * * Licensed under the Apache License, Version 2.0 (the "License");
8  * * you may not use this file except in compliance with the License.
9  * * You may obtain a copy of the License at
10  * * 
11  *  *      http://www.apache.org/licenses/LICENSE-2.0
12  * * 
13  *  * Unless required by applicable law or agreed to in writing, software
14  * * distributed under the License is distributed on an "AS IS" BASIS,
15  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * * See the License for the specific language governing permissions and
17  * * limitations under the License.
18  * * ============LICENSE_END====================================================
19  * *
20  * *
21  ******************************************************************************/
22 package org.onap.aaf.cadi.cass;
23
24 import static org.junit.Assert.*;
25
26 import java.util.HashMap;
27 import java.util.Map;
28 import java.util.Set;
29
30 import org.apache.cassandra.auth.AuthenticatedUser;
31 import org.apache.cassandra.auth.IResource;
32 import org.apache.cassandra.auth.Permission;
33 import org.junit.AfterClass;
34 import org.junit.Assert;
35 import org.junit.BeforeClass;
36 import org.junit.Test;
37
38 import com.att.aaf.cadi.cass.AAFAuthenticator;
39 import com.att.aaf.cadi.cass.AAFAuthorizer;
40
41 public class JU_CASS {
42
43         // TODO: Ian - Fix this test
44         @Test
45         public void notYetImplemented() {
46                 assertTrue(true);
47         }
48
49 //      private static AAFAuthenticator aa;
50 //      private static AAFAuthorizer an;
51
52 //      @BeforeClass
53 //      public static void setUpBeforeClass() throws Exception {
54 //              System.setProperty("cadi_prop_files", "etc/cadi.properties");
55                 
56 //              aa = new AAFAuthenticator();
57 //              an = new AAFAuthorizer();
58
59 //              aa.setup();
60 //              an.setup(); // does nothing after aa.
61                 
62 //              aa.validateConfiguration();
63                 
64 //      }
65
66 //      @AfterClass
67 //      public static void tearDownAfterClass() throws Exception {
68 //      }
69
70 //      @Test
71 //      public void test() throws Exception {
72 //                      Map<String,String> creds = new HashMap<String,String>();
73 //                      creds.put("username", "XXX@NS");
74 //                      creds.put("password", "enc:???");
75 //                      AuthenticatedUser aaf = aa.authenticate(creds);
76
77 //                      // Test out "aaf_default_domain
78 //                      creds.put("username", "XX");
79 //                      aaf = aa.authenticate(creds);
80                         
81 //                      IResource resource = new IResource() {
82 //                              public String getName() {
83 //                                      return "data/authz";
84 //                              }
85
86 //                              public IResource getParent() {
87 //                                      return null;
88 //                              }
89
90 //                              public boolean hasParent() {
91 //                                      return false;
92 //                              }
93
94 //                              public boolean exists() {
95 //                                      return true;
96 //                              }
97                                 
98 //                      };
99                         
100 //                      Set<Permission> perms = an.authorize(aaf, resource);
101                         
102 //                      // Test out "AAF" access
103 //                      creds.put("username", "XXX@NS");
104 //                      creds.put("password", "enc:???");
105 //                      aaf = aa.authenticate(creds);
106 //                      perms = an.authorize(aaf, resource);
107 //                      Assert.assertFalse(perms.isEmpty());
108
109 //                      perms = an.authorize(aaf, resource);
110 //                      Assert.assertFalse(perms.isEmpty());
111                         
112 //      }
113
114 }