1 /*******************************************************************************
2 * ============LICENSE_START====================================================
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
11 * * http://www.apache.org/licenses/LICENSE-2.0
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====================================================
21 ******************************************************************************/
22 package org.onap.aaf.cadi.cass;
24 import static org.junit.Assert.*;
26 import java.util.HashMap;
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;
38 import com.att.aaf.cadi.cass.AAFAuthenticator;
39 import com.att.aaf.cadi.cass.AAFAuthorizer;
41 public class JU_CASS {
43 // TODO: Ian - Fix this test
45 public void notYetImplemented() {
49 // private static AAFAuthenticator aa;
50 // private static AAFAuthorizer an;
53 // public static void setUpBeforeClass() throws Exception {
54 // System.setProperty("cadi_prop_files", "etc/cadi.properties");
56 // aa = new AAFAuthenticator();
57 // an = new AAFAuthorizer();
60 // an.setup(); // does nothing after aa.
62 // aa.validateConfiguration();
67 // public static void tearDownAfterClass() throws Exception {
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);
77 // // Test out "aaf_default_domain
78 // creds.put("username", "XX");
79 // aaf = aa.authenticate(creds);
81 // IResource resource = new IResource() {
82 // public String getName() {
83 // return "data/authz";
86 // public IResource getParent() {
90 // public boolean hasParent() {
94 // public boolean exists() {
100 // Set<Permission> perms = an.authorize(aaf, resource);
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());
109 // perms = an.authorize(aaf, resource);
110 // Assert.assertFalse(perms.isEmpty());