Merge "Cleanup JUnits"
authorJonathan Gathman <jonathan.gathman@att.com>
Thu, 19 Apr 2018 17:18:04 +0000 (17:18 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 19 Apr 2018 17:18:04 +0000 (17:18 +0000)
46 files changed:
cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/test/JU_ErrMessageTest.java [moved from cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/client/JU_ErrMessageTest.java with 98% similarity]
cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/marshal/JU_CertsMarshalTest.java [deleted file]
cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthnTest.java [deleted file]
cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java
cadi/aaf/src/test/java/org/onap/aaf/cadi/lur/aaf/test/JU_JMeter.java
cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_AAFToken.java [moved from cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthToken.java with 73% similarity]
cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java
cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java
cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_Get.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_Get.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_GetAccess.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_GetAccess.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_MultiGet.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_MultiGet.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_SecurityInfoC.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_SecurityInfoC.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/config/test/JU_UsersDump.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/config/JU_UsersDump.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/filter/test/JU_FCGetTest.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/filter/JU_FCGetTest.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_ConfigPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_ConfigPrincipal.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalLur.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalLur.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_LocalPermission.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_LocalPermission.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/lur/test/JU_NullLur.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/lur/JU_NullLur.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_BasicPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_BasicPrincipal.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_CachedBasicPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_CachedBasicPrincipal.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_Kind.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_Kind.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_OAuth2FormPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_OAuth2FormPrincipal.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_StringTagLookup.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_StringTagLookup.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TaggedPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TaggedPrincipal.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_TrustPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_TrustPrincipal.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_UnAuthPrincipal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_UnAuthPrincipal.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/principal/test/JU_X509Principal.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/principal/JU_X509Principal.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/dos/test/JU_DenialOfServiceTaf.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/dos/JU_DenialOfServiceTaf.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_EpiTaf.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_EpiTaf.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_NullTaf.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_NullTaf.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_PuntTafResp.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_PuntTafResp.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustNotTafResp.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustNotTafResp.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/taf/test/JU_TrustTafResp.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/taf/JU_TrustTafResp.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Chmod.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Chmod.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_FQI.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_FQI.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_JsonOutputStream.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_JsonOutputStream.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_MaskFormatException.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_MaskFormatException.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_NetMask.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_NetMask.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Pool.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Split.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Split.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_SubStandardConsole.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_SubStandardConsole.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_TheConsole.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_TheConsole.java with 97% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_UserChainManip.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_UserChainManip.java with 98% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/util/JU_Vars.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_WSSE_Read.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_WSSE_Read.java with 99% similarity]
cadi/core/src/test/java/org/onap/aaf/cadi/wsse/test/JU_XReader.java [moved from cadi/core/src/test/java/org/onap/aaf/cadi/test/wsse/JU_XReader.java with 99% similarity]

@@ -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 (file)
index 9ac6b27..0000000
+++ /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 (file)
index c4000e2..0000000
+++ /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);
-
-       }
-}
index c000495..4c5af01 100644 (file)
@@ -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();
                // }
        }
index 187a4b7..13df1ac 100644 (file)
  ******************************************************************************/
 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());
                }
        }
 
 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"));
+       }
 
 }
index 4092636..8d43c1b 100644 (file)
@@ -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();
index 30496d7..2d252ea 100644 (file)
@@ -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);
+                               };
+                       });
+               }
+       }
+       
 }
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
  * *
  ******************************************************************************/
 
-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;
@@ -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;
@@ -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.*;
@@ -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;
@@ -19,7 +19,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.lur;
+package org.onap.aaf.cadi.lur.test;
 
 import static org.junit.Assert.*;
 
@@ -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;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -18,7 +18,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
 
 import static org.junit.Assert.*;
 
@@ -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.*;
@@ -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.*;
@@ -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.*;
@@ -18,7 +18,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
 
 import static org.junit.Assert.assertEquals;
 
@@ -18,7 +18,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
 
 import static org.junit.Assert.*;
 
@@ -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.*;
@@ -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.*;
@@ -18,7 +18,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
 
 import static org.junit.Assert.assertEquals;
 
@@ -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.*;
@@ -18,7 +18,7 @@
  * *
  * *
  ******************************************************************************/
-package org.onap.aaf.cadi.test.util;
+package org.onap.aaf.cadi.util.test;
 
 import static org.junit.Assert.assertEquals;
 
@@ -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;
@@ -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.*;