AAFCli needs ability to change root_ns for testing 89/55089/1
authorInstrumental <jonathan.gathman@att.com>
Tue, 19 Jun 2018 21:17:21 +0000 (16:17 -0500)
committerInstrumental <jonathan.gathman@att.com>
Tue, 19 Jun 2018 21:17:26 +0000 (16:17 -0500)
Issue-ID: AAF-365
Change-Id: If11e7a3f9cce1f0d2720b0ed656e77113270e9b2
Signed-off-by: Instrumental <jonathan.gathman@att.com>
16 files changed:
auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BaseCmd.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Help.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Version.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_SessClear.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsers.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersContact.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Cred.java
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Delg.java
auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java

index 2efbff7..ab41eb8 100644 (file)
@@ -94,11 +94,11 @@ public class AAFcli {
        }
 
        // Create when only have Access
-       public AAFcli(Access access, Writer wtr, HMangr hman, SecurityInfoC<HttpURLConnection> si, SecuritySetter<HttpURLConnection> ss) throws APIException {
+       public AAFcli(Access access, Writer wtr, HMangr hman, SecurityInfoC<HttpURLConnection> si, SecuritySetter<HttpURLConnection> ss) throws APIException, CadiException {
                this(access,new AuthzEnv(access.getProperties()),wtr,hman, si,ss);
        }
 
-       public AAFcli(Access access, AuthzEnv env, Writer wtr, HMangr hman, SecurityInfoC<HttpURLConnection> si, SecuritySetter<HttpURLConnection> ss) throws APIException {
+       public AAFcli(Access access, AuthzEnv env, Writer wtr, HMangr hman, SecurityInfoC<HttpURLConnection> si, SecuritySetter<HttpURLConnection> ss) throws APIException, CadiException {
                this.env = env;
                this.access = access;
                this.ss = ss;
@@ -112,7 +112,6 @@ public class AAFcli {
                        close = true;
                }
 
-
                /*
                 * Create Cmd Tree
                 */
index 4acd5a8..d9da835 100644 (file)
@@ -184,7 +184,7 @@ public class JU_AAFCli {
                assertTrue(cli.eval("Some random string @#&*& to check complete 100 coverage"));
        }
 
-       public static AAFcli getAAfCli() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public static AAFcli getAAfCli() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                final AuthzEnv env = new AuthzEnv(System.getProperties());
                String aafUrl = "https://DME2RESOLVE";
                SecurityInfoC<HttpURLConnection> si = mock(SecurityInfoC.class);
index c071d95..79a3dd5 100644 (file)
@@ -54,7 +54,7 @@ public class JU_BaseCmd {
        private static BaseCmd bCmd;
 
        @BeforeClass
-       public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                cli = JU_AAFCli.getAAfCli();
                bCmd = new BaseCmd<>(cli, "testString");
        }
index 13394a3..3566555 100644 (file)
@@ -94,7 +94,7 @@ public class JU_Cmd {
        }
        
        @Before
-       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                cli = JU_AAFCli.getAAfCli();
                Param[] param = new Param[] {new Param("name",true)};
                
index bc1f4cc..50da3e3 100644 (file)
@@ -84,7 +84,7 @@ public class JU_Help {
        private static List<Cmd> cmds;
        
        @Before
-       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                cli = JU_AAFCli.getAAfCli();
                cmds = new ArrayList<>();
                Param[] param = new Param[] {new Param("name",true)};
index 884f540..c0ac0f2 100644 (file)
@@ -50,7 +50,7 @@ public class JU_Version {
        private static Version version;
        
        @BeforeClass
-       public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                cli = JU_AAFCli.getAAfCli();
                version = new Version(cli);
        }
index 7ef9c9a..77518d4 100644 (file)
@@ -66,7 +66,7 @@ public class JU_Log {
        AAFcli aafcli;
        
        @Before
-       public void setUp() throws APIException, LocatorException {
+       public void setUp() throws APIException, LocatorException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 1618e78..91d2218 100644 (file)
@@ -66,7 +66,7 @@ public class JU_SessClear {
        AAFcli aafcli;
        
        @Before
-       public  void setUp() throws LocatorException, APIException {
+       public  void setUp() throws LocatorException, APIException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 04fd64f..e0a1128 100644 (file)
@@ -64,7 +64,7 @@ public class JU_Delete {
        AAFcli aafcli;
        
        @Before
-       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 1926249..3edce8d 100644 (file)
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import org.onap.aaf.auth.cmd.ns.List;
 import org.onap.aaf.auth.cmd.ns.NS;
 import org.onap.aaf.auth.env.AuthzEnv;
+import org.onap.aaf.cadi.CadiException;
 import org.onap.aaf.cadi.Locator;
 import org.onap.aaf.cadi.LocatorException;
 import org.onap.aaf.cadi.PropAccess;
@@ -95,7 +96,7 @@ public class JU_List {
        
 
        @Before
-       public void setUp() throws APIException, LocatorException {
+       public void setUp() throws APIException, LocatorException, CadiException {
                PropAccess prop = new PropAccess();
                AuthzEnv aEnv = new AuthzEnv();
                Writer wtr = mock(Writer.class);
index e44a821..909e852 100644 (file)
@@ -32,6 +32,7 @@ import org.onap.aaf.auth.cmd.ns.List;
 import org.onap.aaf.auth.cmd.ns.ListUsers;
 import org.onap.aaf.auth.cmd.ns.NS;
 import org.onap.aaf.auth.cmd.test.JU_AAFCli;
+import org.onap.aaf.cadi.CadiException;
 import org.onap.aaf.cadi.LocatorException;
 import org.onap.aaf.misc.env.APIException;
 
@@ -57,7 +58,7 @@ public class JU_ListUsers {
        ListUsers lUsers;
        
        @Before
-       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException {
                cli = JU_AAFCli.getAAfCli();
                ns = new NS(cli);
                list = new List(ns);
index 14dcbe6..ad48ce3 100644 (file)
@@ -67,7 +67,7 @@ public class JU_ListUsersContact {
        ListUsersContact lUContact;
        
        @Before
-       public void setUp() throws LocatorException, APIException {
+       public void setUp() throws LocatorException, APIException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 781f774..0c85fc3 100644 (file)
@@ -104,7 +104,7 @@ public class JU_List {
        }
        
        @Before
-       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException{
+       public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException, CadiException{
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 9432cbc..eaf8f8c 100644 (file)
@@ -69,7 +69,7 @@ public class JU_Cred {
        AAFcli aafcli;
 
        @Before
-       public void setUp() throws FileNotFoundException, APIException, LocatorException {
+       public void setUp() throws FileNotFoundException, APIException, LocatorException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 3c78841..28d4850 100644 (file)
@@ -68,7 +68,7 @@ public class JU_Delg {
        AAFcli aafcli;
 
        @Before
-       public void setUp() throws FileNotFoundException, APIException, LocatorException {
+       public void setUp() throws FileNotFoundException, APIException, LocatorException, CadiException {
                prop = new PropAccess();
                aEnv = new AuthzEnv();
                wtr = mock(Writer.class);
index 8b96172..0fa5897 100644 (file)
@@ -522,7 +522,6 @@ public class Mapper_2_0 implements Mapper<Nss, Perms, Pkey, Roles, Users, UserRo
                        if(ok.length()>0) {
                                return Result.err(Status.ERR_BadData,ok);
                        }
-
                } else {
                        to.type=0;
                }