summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/test/JU_ErrMessageTest.java (renamed from cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/JU_ErrMessageTest.java)2
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/marshal/JU_CertsMarshalTest.java48
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthnTest.java164
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java2
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java32
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_AAFToken.java (renamed from cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthToken.java)44
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java59
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java257
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_Get.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_Get.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_GetAccess.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_GetAccess.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_MultiGet.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_MultiGet.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_SecurityInfoC.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_SecurityInfoC.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_UsersDump.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_UsersDump.java)4
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/filter/test/JU_FCGetTest.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/filter/JU_FCGetTest.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_ConfigPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_ConfigPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalLur.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalLur.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalPermission.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalPermission.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_NullLur.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_NullLur.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_BasicPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_BasicPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_CachedBasicPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_CachedBasicPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_Kind.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_Kind.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_OAuth2FormPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_OAuth2FormPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_StringTagLookup.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_StringTagLookup.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TaggedPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TaggedPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TrustPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TrustPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_UnAuthPrincipal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_UnAuthPrincipal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_X509Principal.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_X509Principal.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/dos/test/JU_DenialOfServiceTaf.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/dos/JU_DenialOfServiceTaf.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_EpiTaf.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_EpiTaf.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_NullTaf.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_NullTaf.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_PuntTafResp.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_PuntTafResp.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustNotTafResp.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustNotTafResp.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustTafResp.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustTafResp.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Chmod.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Chmod.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_FQI.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_FQI.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_JsonOutputStream.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_JsonOutputStream.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_MaskFormatException.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_MaskFormatException.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_NetMask.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_NetMask.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Pool.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Split.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Split.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_SubStandardConsole.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_SubStandardConsole.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_TheConsole.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_TheConsole.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_UserChainManip.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_UserChainManip.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Vars.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_WSSE_Read.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_WSSE_Read.java)2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_XReader.java (renamed from cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_XReader.java)2
46 files changed, 255 insertions, 431 deletions
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/JU_ErrMessageTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/test/JU_ErrMessageTest.java
index 7094b1a6..273affd3 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/JU_ErrMessageTest.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/test/JU_ErrMessageTest.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.aaf.client;
+package org.onap.aaf.cadi.aaf.client.test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/marshal/JU_CertsMarshalTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/marshal/JU_CertsMarshalTest.java
deleted file mode 100644
index 9ac6b277..00000000
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/marshal/JU_CertsMarshalTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * * ===========================================================================
- * * Licensed under the Apache License, Version 2.0 (the "License");
- * * you may not use this file except in compliance with the License.
- * * You may obtain a copy of the License at
- * *
- * * http://www.apache.org/licenses/LICENSE-2.0
- * *
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS,
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * * See the License for the specific language governing permissions and
- * * limitations under the License.
- * * ============LICENSE_END====================================================
- * *
- * *
- ******************************************************************************/
-package org.onap.aaf.cadi.aaf.marshal;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-import org.onap.aaf.cadi.aaf.marshal.CertsMarshal;
-import org.onap.aaf.misc.rosetta.ParseException;
-
-public class JU_CertsMarshalTest {
-
- @Test
- public void test() throws ParseException {
- CertsMarshal marshal = new CertsMarshal();
- assertNotNull(marshal);
- }
-
- @Test
- public void test2() throws ParseException {
- CertsMarshal marshal = new CertsMarshal();
- assertNotNull(marshal);
- }
-
- @Test
- public void test3() throws ParseException {
- CertsMarshal marshal = new CertsMarshal();
- assertNotNull(marshal);
- }
-}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthnTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthnTest.java
deleted file mode 100644
index c4000e27..00000000
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthnTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * * ===========================================================================
- * * Licensed under the Apache License, Version 2.0 (the "License");
- * * you may not use this file except in compliance with the License.
- * * You may obtain a copy of the License at
- * *
- * * http://www.apache.org/licenses/LICENSE-2.0
- * *
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS,
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * * See the License for the specific language governing permissions and
- * * limitations under the License.
- * * ============LICENSE_END====================================================
- * *
- * *
- ******************************************************************************/
-package org.onap.aaf.cadi.aaf.v2_0;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Mockito.when;
-
-import javax.net.ssl.HttpsURLConnection;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.onap.aaf.cadi.AbsUserCache;
-import org.onap.aaf.cadi.CadiException;
-import org.onap.aaf.cadi.aaf.AAFPermission;
-import org.onap.aaf.cadi.client.Future;
-import org.onap.aaf.cadi.config.Config;
-import org.onap.aaf.misc.env.APIException;
-
-public class JU_AAFAuthnTest {
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- private AAFCon<HttpsURLConnection> con;
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- private Future<String> fp;
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- private AbsUserCache<AAFPermission> cache;
-
-
- @Before
- public void setup() throws APIException, CadiException {
- MockitoAnnotations.initMocks(this);
- when(con.client(Config.AAF_DEFAULT_VERSION).read("/authn/basicAuth", "text/plain")).thenReturn(fp);
- }
- /*TODO broken JUNIT with MOCKITO
- *
- * reduce size of this test file by looping thru conOfClient instead of copy pasta?
- *
- * These appear to receive data but cannot validate them. Maybe due to @before
- * Possible fixes for tomorrow: look into auth,validate, @before mockito, @mock issues?
- *
- */
- @Test
- public void testAAFAuthnAAFConOfCLIENT() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-// assertNotNull(auth.validate("NewUser", "New Password"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
- }
- //TODO broken JUNIT with MOCKITO
- @Test
- public void testAAFAuthnAAFConOfCLIENT1() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-
-// assertNotNull(auth.validate("NewUser1", "New Password1"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission1() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
- }
- //TODO broken JUNIT with MOCKITO
- @Test
- public void testAAFAuthnAAFConOfCLIENT2() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-
-// assertNotNull(auth.validate("NewUser2", "New Password2"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission2() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
-
- }
- //TODO broken JUNIT with MOCKITO
- @Test
- public void testAAFAuthnAAFConOfCLIENT3() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-
-// assertNotNull(auth.validate("NewUser3", "New Password3"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission3() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
-
- }
- //TODO broken JUNIT with MOCKITO
- @Test
- public void testAAFAuthnAAFConOfCLIENT4() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-
-// assertNotNull(auth.validate("NewUser4", "New Password4"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission4() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
-
- }
- //TODO broken JUNIT with MOCKITO
- @Test
- public void testAAFAuthnAAFConOfCLIENT5() throws Exception {
- when(fp.get(anyInt())).thenReturn(false);
- when(fp.code()).thenReturn(401);
- when(fp.header("WWW-Authenticate")).thenReturn("Basic realm=\"Value\"");
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn();
-
-// assertNotNull(auth.validate("NewUser5", "New Password5"));;
- }
-
- @Test
- public void testAAFAuthnAAFConOfCLIENTAbsUserCacheOfAAFPermission5() throws Exception {
- AAFAuthn<HttpsURLConnection> auth = con.newAuthn(cache);
- assertNotNull(auth);
-
- }
-}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java
index c000495a..4c5af016 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java
@@ -71,9 +71,7 @@ public class JU_AAFLocator {
// Item i = al.first();
// i = al.next(i);
// i = al.best();
- // System.out.println("hi");
// } catch (Exception e) {
- // e.printStackTrace();
// Assert.fail();
// }
}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java
index 187a4b7e..13df1ac5 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java
@@ -21,9 +21,13 @@
******************************************************************************/
package org.onap.aaf.cadi.lur.aaf.test;
+import org.junit.*;
+
import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
+import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.HttpURLConnection;
@@ -32,8 +36,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
-import org.junit.BeforeClass;
-import org.junit.Test;
import org.onap.aaf.cadi.Permission;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.aaf.v2_0.AAFAuthn;
@@ -55,8 +57,17 @@ public class JU_JMeter {
private static AAFTaf<HttpURLConnection> aafTaf;
private static PropAccess access;
+ private static ByteArrayOutputStream outStream;
+ private static ByteArrayOutputStream errStream;
+
@BeforeClass
public static void before() throws Exception {
+ outStream = new ByteArrayOutputStream();
+ errStream = new ByteArrayOutputStream();
+
+ System.setOut(new PrintStream(outStream));
+ System.setErr(new PrintStream(errStream));
+
if(aafLur==null) {
Properties props = System.getProperties();
props.setProperty("AFT_LATITUDE", "32.780140");
@@ -106,6 +117,21 @@ public class JU_JMeter {
}
}
+ @Before
+ public void setup() {
+ outStream = new ByteArrayOutputStream();
+ errStream = new ByteArrayOutputStream();
+
+ System.setOut(new PrintStream(outStream));
+ System.setErr(new PrintStream(errStream));
+ }
+
+ @After
+ public void tearDown() {
+ System.setOut(System.out);
+ System.setErr(System.err);
+ }
+
private static class Princ implements Principal {
private String name;
public Princ(String name) {
@@ -136,7 +162,7 @@ public class JU_JMeter {
} catch (Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
- Assert.assertFalse(sw.toString(),true);
+ Assert.fail(sw.toString());
}
}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthToken.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_AAFToken.java
index 0ddb3f4d..11d58ea0 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthToken.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_AAFToken.java
@@ -22,53 +22,29 @@
package org.onap.aaf.cadi.oauth.test;
import static org.junit.Assert.*;
+import org.junit.*;
import java.util.UUID;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.oauth.AAFToken;
-import junit.framework.Assert;
-
-public class JU_OAuthToken {
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
+public class JU_AAFToken {
@Test
public void testMax() throws CadiException {
UUID uuid = new UUID(Long.MAX_VALUE,Long.MAX_VALUE);
String token = AAFToken.toToken(uuid);
- System.out.println(token);
UUID uuid2 = AAFToken.fromToken(token);
- Assert.assertEquals(uuid, uuid2);
+ assertEquals(uuid, uuid2);
}
@Test
public void testMin() throws CadiException {
UUID uuid = new UUID(Long.MIN_VALUE,Long.MIN_VALUE);
String token = AAFToken.toToken(uuid);
- System.out.println(token);
UUID uuid2 = AAFToken.fromToken(token);
- Assert.assertEquals(uuid, uuid2);
+ assertEquals(uuid, uuid2);
}
@Test
@@ -76,11 +52,19 @@ public class JU_OAuthToken {
for(int i=0;i<100;++i) {
UUID uuid = UUID.randomUUID();
String token = AAFToken.toToken(uuid);
- System.out.println(token);
UUID uuid2 = AAFToken.fromToken(token);
- Assert.assertEquals(uuid, uuid2);
+ assertEquals(uuid, uuid2);
}
}
+ @Test
+ public void nullTest() {
+ // Invalid characters
+ assertNull(AAFToken.fromToken("~~invalid characters~~"));
+
+ // Invalid CADI tokens
+ assertNull(AAFToken.fromToken("ABCDEF"));
+ assertNull(AAFToken.fromToken("12345678901234567890123456789012345678"));
+ }
}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java
index 40926364..8d43c1b5 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java
@@ -21,6 +21,8 @@
package org.onap.aaf.cadi.oauth.test;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
import java.net.ConnectException;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -51,11 +53,16 @@ import junit.framework.Assert;
public class JU_OAuthTest {
+ private ByteArrayOutputStream outStream;
+
private static PropAccess access;
private static TokenClientFactory tcf;
@BeforeClass
public static void setUpBeforeClass() {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ System.setOut(new PrintStream(outStream));
+
access = new PropAccess();
try {
tcf = TokenClientFactory.instance(access);
@@ -71,10 +78,13 @@ public class JU_OAuthTest {
@Before
public void setUp() throws Exception {
+ outStream = new ByteArrayOutputStream();
+ System.setOut(new PrintStream(outStream));
}
@After
public void tearDown() throws Exception {
+ System.setOut(System.out);
}
@Test
@@ -190,32 +200,31 @@ public class JU_OAuthTest {
}
}
} catch (Exception e) {
- e.printStackTrace();
// Assert.fail();
}
}
- private TokenClient testROPCFlow(final String url, final String client_id, final String client_secret, String user, String password, final String ... scope) throws Exception {
- TokenClient tclient = tcf.newClient(url,3000);
- tclient.client_creds(client_id, client_secret);
- if(user!=null && password!=null) {
- tclient.password(user,password);
- }
- Result<TimedToken> rt = tclient.getToken(scope);
- if(rt.isOK()) {
- print(rt.value);
- Result<Introspect> rti = tclient.introspect(rt.value.getAccessToken());
- if(rti.isOK()) {
- print(rti.value);
- } else {
- printAndFail(rti);
- }
- } else {
- printAndFail(rt);
- }
- return tclient;
- }
+// private TokenClient testROPCFlow(final String url, final String client_id, final String client_secret, String user, String password, final String ... scope) throws Exception {
+// TokenClient tclient = tcf.newClient(url,3000);
+// tclient.client_creds(client_id, client_secret);
+// if(user!=null && password!=null) {
+// tclient.password(user,password);
+// }
+// Result<TimedToken> rt = tclient.getToken(scope);
+// if(rt.isOK()) {
+// print(rt.value);
+// Result<Introspect> rti = tclient.introspect(rt.value.getAccessToken());
+// if(rti.isOK()) {
+// print(rti.value);
+// } else {
+// printAndFail(rti);
+// }
+// } else {
+// printAndFail(rt);
+// }
+// return tclient;
+// }
private String serviceCall(TzClient tzClient) throws Exception {
return tzClient.best(new Retryable<String>() {
@@ -230,10 +239,10 @@ public class JU_OAuthTest {
}
});
}
- private void printAndFail(Result<?> rt) {
- System.out.printf("HTTP Code %d: %s\n", rt.code, rt.error);
- Assert.fail(rt.toString());
- }
+// private void printAndFail(Result<?> rt) {
+// System.out.printf("HTTP Code %d: %s\n", rt.code, rt.error);
+// Assert.fail(rt.toString());
+// }
private void print(Token t) {
GregorianCalendar exp_date = new GregorianCalendar();
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java
index 30496d78..2d252ea9 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java
@@ -86,128 +86,24 @@ public class SecurityInfo {
try {
this.access = access;
// reuse DME2 Properties for convenience if specific Properties don't exist
- String keyStore = access.getProperty(Config.CADI_KEYSTORE,null);
- if(keyStore!=null && !new File(keyStore).exists()) {
- throw new CadiException(keyStore + " does not exist");
- }
- String keyStorePasswd = access.getProperty(Config.CADI_KEYSTORE_PASSWORD, null);
- keyStorePasswd = keyStorePasswd==null?null:access.decrypt(keyStorePasswd,false);
- String trustStore = access.getProperty(Config.CADI_TRUSTSTORE, null);
- if(trustStore!=null && !new File(trustStore).exists()) {
- throw new CadiException(trustStore + " does not exist");
- }
- String trustStorePasswd = access.getProperty(Config.CADI_TRUSTSTORE_PASSWORD, null);
- trustStorePasswd = trustStorePasswd==null?"changeit"/*defacto Java Trust Pass*/:access.decrypt(trustStorePasswd,false);
- default_alias = access.getProperty(Config.CADI_ALIAS,null);
- String keyPasswd = access.getProperty(Config.CADI_KEY_PASSWORD,null);
- keyPasswd = keyPasswd==null?keyStorePasswd:access.decrypt(keyPasswd,false);
- String tips=access.getProperty(Config.CADI_TRUST_MASKS, null);
- if(tips!=null) {
- access.log(Level.INIT,"Explicitly accepting valid X509s from",tips);
- String[] ipsplit = tips.split(REGEX_COMMA);
- trustMasks = new NetMask[ipsplit.length];
- for(int i=0;i<ipsplit.length;++i) {
- try {
- trustMasks[i]=new NetMask(ipsplit[i]);
- } catch (MaskFormatException e) {
- throw new AccessException("Invalid IP Mask in " + Config.CADI_TRUST_MASKS,e);
- }
- }
- }
- String https_protocols = Config.logProp(access,Config.CADI_PROTOCOLS,
- access.getProperty(HTTPS_PROTOCOLS,HTTPS_PROTOCOLS_DEFAULT)
+ initializeKeyManager();
+
+ initializeTrustManager();
+
+ default_alias = access.getProperty(Config.CADI_ALIAS, null);
+
+ initializeTrustMasks();
+
+ String https_protocols = Config.logProp(access, Config.CADI_PROTOCOLS,
+ access.getProperty(HTTPS_PROTOCOLS, HTTPS_PROTOCOLS_DEFAULT)
);
- System.setProperty(HTTPS_PROTOCOLS,https_protocols);
+ System.setProperty(HTTPS_PROTOCOLS, https_protocols);
System.setProperty(JDK_TLS_CLIENT_PROTOCOLS, https_protocols);
if("1.7".equals(System.getProperty("java.specification.version")) && https_protocols.contains("TLSv1.2")) {
System.setProperty(Config.HTTPS_CIPHER_SUITES, Config.HTTPS_CIPHER_SUITES_DEFAULT);
- }
-
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(SslKeyManagerFactoryAlgorithm);
- File file;
-
-
- if(keyStore==null || keyStorePasswd == null) {
- km = new X509KeyManager[0];
- } else {
- ArrayList<X509KeyManager> kmal = new ArrayList<X509KeyManager>();
- for(String ksname : keyStore.split(REGEX_COMMA)) {
- file = new File(ksname);
- String keystoreFormat;
- if(ksname.endsWith(".p12") || ksname.endsWith(".pkcs12")) {
- keystoreFormat = "PKCS12";
- } else {
- keystoreFormat = "JKS";
- }
- if(file.exists()) {
- FileInputStream fis = new FileInputStream(file);
- try {
- KeyStore ks = KeyStore.getInstance(keystoreFormat);
- ks.load(fis, keyStorePasswd.toCharArray());
- kmf.init(ks, keyPasswd.toCharArray());
- } finally {
- fis.close();
- }
- }
- }
- for(KeyManager km : kmf.getKeyManagers()) {
- if(km instanceof X509KeyManager) {
- kmal.add((X509KeyManager)km);
- }
- }
- km = new X509KeyManager[kmal.size()];
- kmal.toArray(km);
- }
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(SslKeyManagerFactoryAlgorithm);
- if(trustStore!=null) {
- for(String tsname : trustStore.split(REGEX_COMMA)) {
- file = new File(tsname);
- if(file.exists()) {
- FileInputStream fis = new FileInputStream(file);
- try {
- KeyStore ts = KeyStore.getInstance("JKS");
- ts.load(fis, trustStorePasswd.toCharArray());
- tmf.init(ts);
- } finally {
- fis.close();
- }
- }
- }
- TrustManager tms[] = tmf.getTrustManagers();
- if(tms!=null) {
- tm = new X509TrustManager[tms==null?0:tms.length];
- for(int i=0;i<tms.length;++i) {
- try {
- tm[i]=(X509TrustManager)tms[i];
- } catch (ClassCastException e) {
- access.log(Level.WARN, "Non X509 TrustManager", tm[i].getClass().getName(),"skipped in SecurityInfo");
- }
- }
- }
- }
-
- if(trustMasks!=null) {
- final HostnameVerifier origHV = HttpsURLConnection.getDefaultHostnameVerifier();
- HttpsURLConnection.setDefaultHostnameVerifier(maskHV = new HostnameVerifier() {
- @Override
- public boolean verify(final String urlHostName, final SSLSession session) {
- try {
- // This will pick up /etc/host entries as well as DNS
- InetAddress ia = InetAddress.getByName(session.getPeerHost());
- for(NetMask tmask : trustMasks) {
- if(tmask.isInNet(ia.getHostAddress())) {
- return true;
- }
- }
- } catch (UnknownHostException e) {
- // It's ok. do normal Verify
- }
- return origHV.verify(urlHostName,session);
- };
- });
- }
+ }
+
ctx = SSLContext.getInstance("TLS");
ctx.init(km, tm, null);
SSLContext.setDefault(ctx);
@@ -249,9 +145,134 @@ public class SecurityInfo {
public void setSocketFactoryOn(HttpsURLConnection hsuc) {
hsuc.setSSLSocketFactory(scf);
- if(maskHV!=null && !maskHV.equals(hsuc.getHostnameVerifier())) {
+ if(maskHV != null && !maskHV.equals(hsuc.getHostnameVerifier())) {
hsuc.setHostnameVerifier(maskHV);
}
}
+
+ protected void initializeKeyManager() throws CadiException, IOException, NoSuchAlgorithmException, KeyStoreException, CertificateException, UnrecoverableKeyException {
+ String keyStore = access.getProperty(Config.CADI_KEYSTORE, null);
+ if(keyStore != null && !new File(keyStore).exists()) {
+ throw new CadiException(keyStore + " does not exist");
+ }
+
+ String keyStorePasswd = access.getProperty(Config.CADI_KEYSTORE_PASSWORD, null);
+ keyStorePasswd = (keyStorePasswd == null) ? null : access.decrypt(keyStorePasswd, false);
+
+ String keyPasswd = access.getProperty(Config.CADI_KEY_PASSWORD, null);
+ keyPasswd = (keyPasswd == null) ? keyStorePasswd : access.decrypt(keyPasswd, false);
+
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance(SslKeyManagerFactoryAlgorithm);
+ if(keyStore == null || keyStorePasswd == null) {
+ km = new X509KeyManager[0];
+ } else {
+ ArrayList<X509KeyManager> kmal = new ArrayList<X509KeyManager>();
+ File file;
+ for(String ksname : keyStore.split(REGEX_COMMA)) {
+ file = new File(ksname);
+ String keystoreFormat;
+ if(ksname.endsWith(".p12") || ksname.endsWith(".pkcs12")) {
+ keystoreFormat = "PKCS12";
+ } else {
+ keystoreFormat = "JKS";
+ }
+ if(file.exists()) {
+ FileInputStream fis = new FileInputStream(file);
+ try {
+ KeyStore ks = KeyStore.getInstance(keystoreFormat);
+ ks.load(fis, keyStorePasswd.toCharArray());
+ kmf.init(ks, keyPasswd.toCharArray());
+ } finally {
+ fis.close();
+ }
+ }
+ }
+ for(KeyManager km : kmf.getKeyManagers()) {
+ if(km instanceof X509KeyManager) {
+ kmal.add((X509KeyManager)km);
+ }
+ }
+ km = new X509KeyManager[kmal.size()];
+ kmal.toArray(km);
+ }
+ }
+
+ protected void initializeTrustManager() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, CadiException {
+ String trustStore = access.getProperty(Config.CADI_TRUSTSTORE, null);
+ if(trustStore != null && !new File(trustStore).exists()) {
+ throw new CadiException(trustStore + " does not exist");
+ }
+
+ String trustStorePasswd = access.getProperty(Config.CADI_TRUSTSTORE_PASSWORD, null);
+ trustStorePasswd = (trustStorePasswd == null) ? "changeit"/*defacto Java Trust Pass*/ : access.decrypt(trustStorePasswd, false);
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(SslKeyManagerFactoryAlgorithm);
+ if(trustStore != null) {
+ File file;
+ for(String tsname : trustStore.split(REGEX_COMMA)) {
+ file = new File(tsname);
+ if(file.exists()) {
+ FileInputStream fis = new FileInputStream(file);
+ try {
+ KeyStore ts = KeyStore.getInstance("JKS");
+ ts.load(fis, trustStorePasswd.toCharArray());
+ tmf.init(ts);
+ } finally {
+ fis.close();
+ }
+ }
+ }
+
+ TrustManager tms[] = tmf.getTrustManagers();
+ if(tms != null) {
+ tm = new X509TrustManager[(tms == null) ? 0 : tms.length];
+ for(int i = 0; i < tms.length; ++i) {
+ try {
+ tm[i] = (X509TrustManager)tms[i];
+ } catch (ClassCastException e) {
+ access.log(Level.WARN, "Non X509 TrustManager", tm[i].getClass().getName(), "skipped in SecurityInfo");
+ }
+ }
+ }
+ }
+
+ }
+
+ protected void initializeTrustMasks() throws AccessException {
+ String tips = access.getProperty(Config.CADI_TRUST_MASKS, null);
+ if(tips != null) {
+ access.log(Level.INIT, "Explicitly accepting valid X509s from", tips);
+ String[] ipsplit = tips.split(REGEX_COMMA);
+ trustMasks = new NetMask[ipsplit.length];
+ for(int i = 0; i < ipsplit.length; ++i) {
+ try {
+ trustMasks[i] = new NetMask(ipsplit[i]);
+ } catch (MaskFormatException e) {
+ throw new AccessException("Invalid IP Mask in " + Config.CADI_TRUST_MASKS, e);
+ }
+ }
+ }
+
+ if(trustMasks != null) {
+ final HostnameVerifier origHV = HttpsURLConnection.getDefaultHostnameVerifier();
+ HttpsURLConnection.setDefaultHostnameVerifier(maskHV = new HostnameVerifier() {
+ @Override
+ public boolean verify(final String urlHostName, final SSLSession session) {
+ try {
+ // This will pick up /etc/host entries as well as DNS
+ InetAddress ia = InetAddress.getByName(session.getPeerHost());
+ for(NetMask tmask : trustMasks) {
+ if(tmask.isInNet(ia.getHostAddress())) {
+ return true;
+ }
+ }
+ } catch (UnknownHostException e) {
+ // It's ok. do normal Verify
+ }
+ return origHV.verify(urlHostName, session);
+ };
+ });
+ }
+ }
+
}
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_Get.java b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_Get.java
index 5f89060e..586c50c7 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_Get.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_Get.java
@@ -19,7 +19,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.config;
+package org.onap.aaf.cadi.config.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_GetAccess.java b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_GetAccess.java
index 5acd39f9..36da3073 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_GetAccess.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_GetAccess.java
@@ -19,7 +19,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.config;
+package org.onap.aaf.cadi.config.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_MultiGet.java b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_MultiGet.java
index e678421c..6510bdcd 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_MultiGet.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_MultiGet.java
@@ -19,7 +19,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.config;
+package org.onap.aaf.cadi.config.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_SecurityInfoC.java b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_SecurityInfoC.java
index ecd514fd..27014b9a 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_SecurityInfoC.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_SecurityInfoC.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.config;
+package org.onap.aaf.cadi.config.test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_UsersDump.java b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_UsersDump.java
index f6e366a7..63b8cf2d 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_UsersDump.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_UsersDump.java
@@ -19,13 +19,11 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.config;
+package org.onap.aaf.cadi.config.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
-import static org.mockito.Mockito.*;
import org.junit.*;
-import org.mockito.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/filter/JU_FCGetTest.java b/cadi/core/src/test/java/org/onap/aaf/cadi/filter/test/JU_FCGetTest.java
index 967334ac..694c59e7 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/filter/JU_FCGetTest.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/filter/test/JU_FCGetTest.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.filter;
+package org.onap.aaf.cadi.filter.test;
import static org.junit.Assert.*;
import static org.mockito.Mockito.when;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_ConfigPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_ConfigPrincipal.java
index 897744ec..9853f88e 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_ConfigPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_ConfigPrincipal.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.lur;
+package org.onap.aaf.cadi.lur.test;
import org.junit.*;
import static org.junit.Assert.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalLur.java b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalLur.java
index 8388fa5f..fd8e3575 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalLur.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalLur.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.lur;
+package org.onap.aaf.cadi.lur.test;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalPermission.java b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalPermission.java
index abc178a8..f4b051a8 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalPermission.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalPermission.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.lur;
+package org.onap.aaf.cadi.lur.test;
import static org.junit.Assert.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_NullLur.java b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_NullLur.java
index d5740b3a..1a7293d3 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_NullLur.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_NullLur.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.lur;
+package org.onap.aaf.cadi.lur.test;
import java.security.Principal;
import java.util.List;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_BasicPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_BasicPrincipal.java
index 0faaca1a..dee7fc21 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_BasicPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_BasicPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_CachedBasicPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_CachedBasicPrincipal.java
index 39da6c09..aa9a01a5 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_CachedBasicPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_CachedBasicPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_Kind.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_Kind.java
index c66539c4..e9bd799c 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_Kind.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_Kind.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_OAuth2FormPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_OAuth2FormPrincipal.java
index a7c14aa8..c0b1c2af 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_OAuth2FormPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_OAuth2FormPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_StringTagLookup.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_StringTagLookup.java
index ff1f3f8a..cce86255 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_StringTagLookup.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_StringTagLookup.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TaggedPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TaggedPrincipal.java
index 4674db70..2bbfee23 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TaggedPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TaggedPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TrustPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TrustPrincipal.java
index 4a7333e2..12b4bc9f 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TrustPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TrustPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_UnAuthPrincipal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_UnAuthPrincipal.java
index 9d694a53..c0095131 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_UnAuthPrincipal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_UnAuthPrincipal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_X509Principal.java b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_X509Principal.java
index a45ce24e..e62dda4f 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_X509Principal.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_X509Principal.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.principal;
+package org.onap.aaf.cadi.principal.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/dos/JU_DenialOfServiceTaf.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/dos/test/JU_DenialOfServiceTaf.java
index 40933b41..ce49654b 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/dos/JU_DenialOfServiceTaf.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/dos/test/JU_DenialOfServiceTaf.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf.dos;
+package org.onap.aaf.cadi.taf.dos.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_EpiTaf.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_EpiTaf.java
index baab0b6a..a1190590 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_EpiTaf.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_EpiTaf.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf;
+package org.onap.aaf.cadi.taf.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_NullTaf.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_NullTaf.java
index 9131172e..f42184df 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_NullTaf.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_NullTaf.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf;
+package org.onap.aaf.cadi.taf.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_PuntTafResp.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_PuntTafResp.java
index 8c5397dc..516f4044 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_PuntTafResp.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_PuntTafResp.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf;
+package org.onap.aaf.cadi.taf.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustNotTafResp.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustNotTafResp.java
index 798348e8..b032c020 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustNotTafResp.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustNotTafResp.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf;
+package org.onap.aaf.cadi.taf.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustTafResp.java b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustTafResp.java
index 04e3a1fc..10b5f146 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustTafResp.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustTafResp.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.taf;
+package org.onap.aaf.cadi.taf.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Chmod.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Chmod.java
index 215980ff..62114189 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Chmod.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Chmod.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_FQI.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_FQI.java
index 57177839..bcd2f776 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_FQI.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_FQI.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_JsonOutputStream.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_JsonOutputStream.java
index d07652a1..da3557cb 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_JsonOutputStream.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_JsonOutputStream.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_MaskFormatException.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_MaskFormatException.java
index 6a60df68..ea743430 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_MaskFormatException.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_MaskFormatException.java
@@ -20,7 +20,7 @@
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_NetMask.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_NetMask.java
index be3b1b32..403f1f1e 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_NetMask.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_NetMask.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.assertEquals;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Pool.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java
index ef4bc687..79209322 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Pool.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Split.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Split.java
index e375f6c0..12be4e15 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Split.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Split.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_SubStandardConsole.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_SubStandardConsole.java
index 9e6a175c..4d8e8f84 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_SubStandardConsole.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_SubStandardConsole.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_TheConsole.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_TheConsole.java
index f168c7f4..40f88a3a 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_TheConsole.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_TheConsole.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.assertEquals;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_UserChainManip.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_UserChainManip.java
index 949d034b..21f8c21b 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_UserChainManip.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_UserChainManip.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Vars.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java
index 345c8ca2..32ca8f84 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Vars.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java
@@ -18,7 +18,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
import static org.junit.Assert.assertEquals;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_WSSE_Read.java b/cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_WSSE_Read.java
index 26dd43b1..599987d7 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_WSSE_Read.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_WSSE_Read.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.wsse;
+package org.onap.aaf.cadi.wsse.test;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_XReader.java b/cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_XReader.java
index dd90e220..15fe1145 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_XReader.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_XReader.java
@@ -19,7 +19,7 @@
* *
* *
******************************************************************************/
-package org.onap.aaf.cadi.test.wsse;
+package org.onap.aaf.cadi.wsse.test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;