diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/Key.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/Key.java
index fb43a42..1ee655f 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/Key.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/Key.java
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +23,7 @@
 
 package org.onap.aaf.auth.batch.actions;
 
+@FunctionalInterface
 public interface Key<HELPER> {
     public String key(HELPER H);
 }
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/History.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/History.java
index a172738..0a50ae0 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/History.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/History.java
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2018 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,9 +45,60 @@
     public final String subject;
     public final String target;
     public final String user;
-    public final int yr_mon;
+    public final int yrMon;
+
+    public static Creator<History> sansConstruct = new Creator<History> () {
+        @Override
+        public History create(Row row) {
+            return new History(
+                    row.getUUID(0),
+                    row.getString(1),
+                    row.getString(2),
+                    row.getString(3),
+                    row.getString(4),
+                    row.getString(5),
+                    row.getInt(6));
+        }
+
+        @Override
+        public String select() {
+            return "SELECT id, action, memo, subject, target, user, yr_mon from authz.history LIMIT 10000000 ";
+        }
+    };
+
+    public static Creator<History> avecConstruct = new Creator<History> () {
+        private final StringBuilder sb = new StringBuilder();
+
+        @Override
+        public History create(Row row) {
+            ByteBuffer bb = row.getBytes(3);
+            sb.setLength(0);
+
+            if (bb!=null && bb.hasRemaining()) {
+                sb.append("0x");
+                while (bb.hasRemaining()) {
+                    sb.append(String.format("%02x",bb.get()));
+                }
+                bb.flip();
+            }
+            return new History(
+                    row.getUUID(0),
+                    row.getString(1),
+                    row.getString(2),
+                    sb.toString(),
+                    row.getString(4),
+                    row.getString(5),
+                    row.getString(6),
+                    row.getInt(7));
+        }
+
+        @Override
+        public String select() {
+            return "SELECT id, action, memo, reconstruct, subject, target, user, yr_mon from authz.history LIMIT 10000000 ";
+        }
+    };
     
-    public History(UUID id, String action, String memo, String subject, String target, String user, int yr_mon) {
+    public History(UUID id, String action, String memo, String subject, String target, String user, int yrMon) {
         this.id = id;
         this.action = action;
         this.memo = memo;
@@ -53,10 +106,10 @@
         this.subject = subject;
         this.target = target;
         this.user = user;
-        this.yr_mon = yr_mon;
+        this.yrMon = yrMon;
     }
     
-    public History(UUID id, String action, String memo, String reconstruct, String subject, String target, String user, int yr_mon) {
+    public History(UUID id, String action, String memo, String reconstruct, String subject, String target, String user, int yrMon) {
         this.id = id;
         this.action = action;
         this.memo = memo;
@@ -64,7 +117,7 @@
         this.subject = subject;
         this.target = target;
         this.user = user;
-        this.yr_mon = yr_mon;
+        this.yrMon = yrMon;
     }
 
     public static void load(Trans trans, Session session, Creator<History> creator, Loader<History> loader) {
@@ -100,7 +153,7 @@
     public String toString() {
         return String.format("%s %d %s, %s, %s, %s, %s", 
                 id.toString(),
-                yr_mon,
+                yrMon,
                 user,
                 target,
                 action,
@@ -123,56 +176,4 @@
     public boolean equals(Object obj) {
         return id.equals(obj);
     }
-    
-    public static Creator<History> sansConstruct = new Creator<History> () {
-        @Override
-        public History create(Row row) {
-            return new History(
-                    row.getUUID(0),
-                    row.getString(1),
-                    row.getString(2),
-                    row.getString(3),
-                    row.getString(4),
-                    row.getString(5),
-                    row.getInt(6));
-        }
-
-        @Override
-        public String select() {
-            return "SELECT id, action, memo, subject, target, user, yr_mon from authz.history LIMIT 10000000 ";
-        }
-    };
-
-    public static Creator<History> avecConstruct = new Creator<History> () {
-        private final StringBuilder sb = new StringBuilder();
-        
-        @Override
-        public History create(Row row) {
-            ByteBuffer bb = row.getBytes(3);
-            sb.setLength(0);
-            
-            if (bb!=null && bb.hasRemaining()) {
-                sb.append("0x");
-                while (bb.hasRemaining()) {
-                    sb.append(String.format("%02x",bb.get()));
-                }
-                bb.flip();
-            }
-            return new History(
-                    row.getUUID(0),
-                    row.getString(1),
-                    row.getString(2),
-                    sb.toString(),
-                    row.getString(4),
-                    row.getString(5),
-                    row.getString(6),
-                    row.getInt(7));
-        }
-
-        @Override
-        public String select() {
-            return "SELECT id, action, memo, reconstruct, subject, target, user, yr_mon from authz.history LIMIT 10000000 ";
-        }
-    };
-
 }
\ No newline at end of file
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
index d8eee6d..7ed26ce 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,20 +121,17 @@
 
 			Map<String, Set<UserRole>> owners = new TreeMap<String, Set<UserRole>>();
 			trans.info().log("Process UserRoles");
-			UserRole.load(trans, session, UserRole.v2_0_11, new Visitor<UserRole>() {
-				@Override
-				public void visit(UserRole ur) {
-					// Cannot just delete owners, unless there is at least one left. Process later
-					if ("owner".equals(ur.rname())) {
-						Set<UserRole> urs = owners.get(ur.role());
-						if (urs == null) {
-							urs = new HashSet<UserRole>();
-							owners.put(ur.role(), urs);
-						}
-						urs.add(ur);
-					} else {
-						writeAnalysis(trans,ur);
+			UserRole.load(trans, session, UserRole.v2_0_11, ur -> {
+				// Cannot just delete owners, unless there is at least one left. Process later
+				if ("owner".equals(ur.rname())) {
+					Set<UserRole> urs = owners.get(ur.role());
+					if (urs == null) {
+						urs = new HashSet<UserRole>();
+						owners.put(ur.role(), urs);
 					}
+					urs.add(ur);
+				} else {
+					writeAnalysis(trans,ur);
 				}
 			});
 
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyCredExpiring.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyCredExpiring.java
index ab7525b..ce00816 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyCredExpiring.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/NotifyCredExpiring.java
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2018 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,9 +30,7 @@
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -48,11 +48,9 @@
 import org.onap.aaf.auth.batch.helpers.Notification;
 import org.onap.aaf.auth.batch.helpers.UserRole;
 import org.onap.aaf.auth.batch.helpers.Notification.TYPE;
-import org.onap.aaf.auth.dao.cass.CredDAO;
 import org.onap.aaf.auth.dao.hl.Question;
 import org.onap.aaf.auth.env.AuthzTrans;
 import org.onap.aaf.auth.layer.Result;
-import org.onap.aaf.auth.org.EmailWarnings;
 import org.onap.aaf.auth.org.Organization;
 import org.onap.aaf.auth.org.Organization.Identity;
 import org.onap.aaf.auth.org.OrganizationException;
diff --git a/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/reports/bodies/AbsCredBodyTest.java b/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/reports/bodies/AbsCredBodyTest.java
new file mode 100644
index 0000000..b38344a
--- /dev/null
+++ b/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/reports/bodies/AbsCredBodyTest.java
@@ -0,0 +1,62 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2019 IBM 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.auth.batch.reports.bodies;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.aaf.auth.batch.reports.Notify;
+import org.onap.aaf.auth.env.AuthzTrans;
+
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+public class AbsCredBodyTest {
+
+    @Test
+    public void testUserWithValue() {
+        String testStr = "test";
+        List<String> row = Collections.singletonList(testStr);
+        AbsCredBody absCredBody = new AbsCredBody("") {
+            @Override
+            public String body(AuthzTrans trans, Notify n, String id) {
+                return null;
+            }
+        };
+        Assert.assertEquals(testStr, absCredBody.user(row));
+    }
+
+    @Test
+    public void testUserWithoutValue() {
+        //String testStr = "test";
+        List<String> row = Collections.EMPTY_LIST;
+        AbsCredBody absCredBody = new AbsCredBody("") {
+            @Override
+            public String body(AuthzTrans trans, Notify n, String id) {
+                return null;
+            }
+        };
+        Assert.assertNull(absCredBody.user(row));
+    }
+}
\ No newline at end of file
diff --git a/auth/auth-certman/pom.xml b/auth/auth-certman/pom.xml
index cd20bd0..76f2622 100644
--- a/auth/auth-certman/pom.xml
+++ b/auth/auth-certman/pom.xml
@@ -49,6 +49,12 @@
 	</properties>
 
 	<dependencies>
+         <dependency>
+          <groupId>org.powermock</groupId>
+          <artifactId>powermock-module-junit4-rule-agent</artifactId>
+          <version>1.6.4</version>
+          <scope>test</scope>
+        </dependency>
 		<dependency>
 			<groupId>org.onap.aaf.authz</groupId>
 			<artifactId>aaf-auth-core</artifactId>
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
index 689326e..bfdb977 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
@@ -80,7 +80,12 @@
     public final  Cluster cluster;
     public final LocateDAO locateDAO;
     public static AuthzEnv envLog;
+    CMService service;
 
+    //Added for junits
+    public CMService getService() {
+    	return null;
+    }
     /**
      * Construct AuthzAPI with all the Context Supporting Routes that Authz needs
      * 
@@ -117,7 +122,6 @@
             if (key.startsWith(CA.CM_CA_PREFIX)) {
                 int idx = key.indexOf('.');
                 if (idx==key.lastIndexOf('.')) { // else it's a regular property 
-    
                     env.log(Level.INIT, "Loading Certificate Authority Module: " + key.substring(idx+1));
                     String[] segs = Split.split(',', env.getProperty(key));
                     if (segs.length>0) {
@@ -145,7 +149,10 @@
             throw new APIException("No Certificate Authorities have been configured in CertMan");
         }
 
-        CMService service = new CMService(trans, this);
+        service = getService();
+        if(service == null) {
+        	service = new CMService(trans, this);
+        }
         // note: Service knows how to shutdown Cluster on Shutdown, etc.  See Constructor
         facade1_0 = FacadeFactory.v1_0(this,trans, service,Data.TYPE.JSON);   // Default Facade
         facade1_0_XML = FacadeFactory.v1_0(this,trans,service,Data.TYPE.XML); 
@@ -172,6 +179,7 @@
     public CA getCA(String key) {
         return certAuths.get(key);
     }
+    
 
     /**
      * Setup XML and JSON implementations for each supported Version type
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java
new file mode 100644
index 0000000..632e719
--- /dev/null
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/LocalCAImpl.java
@@ -0,0 +1,48 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 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.auth.cm;
+
+import java.io.IOException;
+
+import org.onap.aaf.auth.cm.ca.CA;
+import org.onap.aaf.auth.cm.ca.X509andChain;
+import org.onap.aaf.auth.cm.cert.CSRMeta;
+import org.onap.aaf.cadi.Access;
+import org.onap.aaf.cadi.configure.CertException;
+import org.onap.aaf.misc.env.Trans;
+
+public class LocalCAImpl extends CA {
+
+	protected LocalCAImpl(Access access, String caName, String env) throws IOException, CertException {
+		super(access, caName, env);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public LocalCAImpl(Access access, final String name, final String env, final String[][] params) throws IOException, CertException {
+		super(access, name, env);
+	}
+
+	@Override
+	public X509andChain sign(Trans trans, CSRMeta csrmeta) throws IOException, CertException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
\ No newline at end of file
diff --git a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/JU_AAF_CM.java b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/JU_AAF_CM.java
new file mode 100644
index 0000000..e770fec
--- /dev/null
+++ b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/JU_AAF_CM.java
@@ -0,0 +1,226 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 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.auth.cm;
+
+import static org.junit.Assert.assertTrue;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.security.NoSuchAlgorithmException;
+import java.util.Properties;
+
+import javax.servlet.Filter;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.cm.ca.CA;
+import org.onap.aaf.auth.cm.facade.Facade1_0;
+import org.onap.aaf.auth.cm.facade.FacadeFactory;
+import org.onap.aaf.auth.cm.mapper.Mapper.API;
+import org.onap.aaf.auth.cm.service.CMService;
+import org.onap.aaf.auth.cm.service.Code;
+import org.onap.aaf.auth.env.AuthzEnv;
+import org.onap.aaf.auth.env.AuthzTransImpl;
+import org.onap.aaf.auth.rserv.HttpMethods;
+import org.onap.aaf.cadi.CadiException;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.PropAccess;
+import org.onap.aaf.cadi.aaf.v2_0.AAFConHttp;
+import org.onap.aaf.cadi.config.Config;
+import org.onap.aaf.misc.env.Data;
+import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.misc.env.LogTarget;
+import org.onap.aaf.misc.env.TimeTaken;
+import org.onap.aaf.misc.env.impl.BasicEnv;
+import org.onap.aaf.misc.rosetta.env.RosettaDF;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(FacadeFactory.class)
+public class JU_AAF_CM {
+
+	@Mock
+	AuthzEnv env;
+	
+	BasicEnv baseEnv;
+	
+	@Mock
+	PropAccess access;
+	
+	AuthzTransImpl1 trans;
+	
+	AAF_CMImpl rosettaObj = null;
+	
+	@Before
+	public void setUp() {
+		initMocks(this);
+		
+		try {
+			Mockito.doReturn(access).when(env).access();
+			Mockito.doReturn("test.test").when(access).getProperty(Config.AAF_ROOT_NS,"org.osaaf.aaf");
+			Properties props=new Properties();
+			Mockito.doReturn(props).when(access).getProperties();
+			props.setProperty("cm_ca.props", "test");
+			Mockito.doReturn("test:2.1").when(access).getProperty(Config.AAF_COMPONENT, null);
+			Mockito.doReturn("test").when(access).getProperty("https.protocols","TLSv1.1,TLSv1.2");
+			Mockito.doReturn("test").when(env).getProperty("cm_ca.props.perm_type",null);
+			Mockito.doReturn("test").when(env).getProperty("cm_ca.props.baseSubject",null);
+			Mockito.doReturn("10").when(env).getProperty("CACHE_CLEAN_INTERVAL","60000");
+			Mockito.doReturn("10").when(env).getProperty("CACHE_HIGH_COUNT","5000");
+			trans = new AuthzTransImpl1(env);
+			Mockito.doReturn(trans).when(env).newTrans();
+//			Mockito.doReturn("test").when(trans).getProperty("cm_ca.props.baseSubject",null);
+//			Mockito.doReturn(Mockito.mock(TimeTaken.class)).when(trans).start("Clear Reset Deque",8);
+			
+			Mockito.doReturn("TLSv1.1").when(access).getProperty("cadi_protocols","test");
+			Mockito.doReturn("https://www.google.com").when(access).getProperty(Config.AAF_URL,null);
+			Mockito.doReturn("test").when(env).getProperty(Config.AAF_ENV);
+			Mockito.doReturn("10").when(env).getProperty(Config.CADI_LATITUDE);
+			Mockito.doReturn("10").when(env).getProperty(Config.CADI_LONGITUDE);
+			Mockito.doReturn("org.onap.aaf.auth.cm.LocalCAImpl,test;test").when(env).getProperty("cm_ca.props");
+			Mockito.doReturn("google.com").when(env).getProperty("cassandra.clusters",null);
+//			Mockito.doReturn(Mockito.mock(AuthzTransImpl.class)).when(env).newTrans();
+			Mockito.doReturn(Mockito.mock(LogTarget.class)).when(env).init();
+			AAF_CM tempObj = Mockito.mock(AAF_CM.class);
+			Field envField = tempObj.getClass().getField("env");
+			Field modifiersField = Field.class.getDeclaredField("modifiers");
+	        modifiersField.setAccessible(true);
+	        modifiersField.setInt(envField, envField.getModifiers() & ~Modifier.FINAL);
+			envField.setAccessible(true);
+	        envField.set(tempObj, env);
+	        RosettaDF rosettaObjTemp = Mockito.mock(RosettaDF.class);
+	        Mockito.doReturn(rosettaObjTemp).when(rosettaObjTemp).in(Data.TYPE.JSON);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(aaf.v2_0.Error.class);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(certman.v1_0.CertificateRequest.class);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(certman.v1_0.CertificateRenew.class);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(certman.v1_0.CertificateDrop.class);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(certman.v1_0.CertInfo.class);
+	        Mockito.doReturn(rosettaObjTemp).when(env).newDataFactory(certman.v1_0.Artifacts.class);
+	        Mockito.doReturn(Data.TYPE.XML).when(rosettaObjTemp).getOutType();
+
+	        Facade1_0 facadeObj = Mockito.mock(Facade1_0.class);
+			PowerMockito.mockStatic(FacadeFactory.class);
+			FacadeFactory factObj = PowerMockito.mock(FacadeFactory.class);
+			PowerMockito.when(factObj.v1_0(tempObj,trans, null,Data.TYPE.JSON)).thenReturn(facadeObj);
+			
+//			Mockito.doReturn(Mockito.mock(Mapper.class)).when(facadeObj).mapper();
+
+			
+			rosettaObj = new AAF_CMImpl(env);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			assertTrue(e instanceof NullPointerException);
+		}
+	}
+	
+	@Test
+	public void testTestCA() {
+		CA obj = rosettaObj.getCA("props");
+		assertTrue(obj instanceof CA);
+	}
+	
+//	@Test
+//	public void testRoute() {
+//		try {
+//			rosettaObj.route(null, "", null, null);
+//		} catch (Exception e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+////		System.out.println(obj);
+////		assertTrue(obj instanceof CA);
+//	}
+	
+	@Test
+	public void testFilters() {
+		try {
+			Filter[] obj = rosettaObj._filters(new Object[] {"props"});
+			System.out.println(obj);
+		} catch (CadiException | LocatorException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			assertTrue(e.getMessage().contains("NoSuchAlgorithmException"));
+		}
+//		assertTrue(obj instanceof CA);
+	}
+	
+	class AAF_CMImpl extends AAF_CM{
+
+		public AAF_CMImpl(AuthzEnv env) throws Exception {
+			super(env);
+			// TODO Auto-generated constructor stub
+		}
+		
+		@Override
+		public synchronized AAFConHttp aafCon() throws CadiException, LocatorException {
+			return Mockito.mock(AAFConHttp.class);
+		}
+		
+		public CMService getService() {
+	    	return Mockito.mock(CMService.class);
+	    }
+		
+		@Override
+		public void route(HttpMethods meth, String path, API api, Code code) throws Exception {
+			
+		}
+	}
+	
+	
+	
+	class AuthzTransImpl1 extends AuthzTransImpl{
+
+		public AuthzTransImpl1(AuthzEnv env) {
+			super(env);
+			// TODO Auto-generated constructor stub
+		}
+
+		@Override
+		protected TimeTaken newTimeTaken(String name, int flag) {
+			// TODO Auto-generated method stub
+			TimeTaken tt= new TimeTaken("nameTest", Env.XML) {
+				
+				@Override
+				public void output(StringBuilder sb) {
+					// TODO Auto-generated method stub
+					
+				}
+			};
+			return tt;
+		}
+		
+		@Override
+		public Metric auditTrail(int indent, StringBuilder sb, int ... flag) {
+			return null;
+		}
+		
+	}
+	
+
+}
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Grant.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Grant.java
index dd45fb4..ca958c2 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Grant.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Grant.java
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2018 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,7 +43,7 @@
  *
  */
 public class Grant extends Cmd {
-    private final static String[] options = {"grant","ungrant","setTo"};
+    private static final String[] options = {"grant","ungrant","setTo"};
 
     public Grant(Perm parent) {
         super(parent,null,
@@ -74,7 +76,8 @@
         
                 if (option != 2) {
                     String[] roles = args[idx++].split(",");
-                    String strA,strB;
+                    String strA;
+                    String strB;
                     for (String role : roles) {
                         rpr.setRole(role);
                         if (option==0) {
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java
new file mode 100644
index 0000000..241622f
--- /dev/null
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * ============LICENSE_START====================================================
+ * * org.onap.aaf
+ * * ===========================================================================
+ * * Copyright © 2019 IBM 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.auth.layer;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.aaf.misc.env.Data.TYPE;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class FacadeImplTest {
+
+    FacadeImpl facade;
+    HttpServletResponse response;
+
+    @Before
+    public void setUp() throws Exception {
+        facade = new FacadeImpl() {
+        };
+        response = mock(HttpServletResponse.class);
+    }
+
+    @Test
+    public void setContentType() {
+        TYPE type = TYPE.JSON;
+        facade.setContentType(response, type);
+        verify(response).setContentType("application/json");
+
+        type = TYPE.XML;
+        facade.setContentType(response, type);
+        verify(response).setContentType("text.xml");
+    }
+
+    @Test
+    public void setCacheControlOff() {
+        facade.setCacheControlOff(response);
+        verify(response).setHeader("Cache-Control", "no-store");
+        verify(response).setHeader("Pragma", "no-cache");
+    }
+}
\ No newline at end of file
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/log4j/test/JU_Log4jAccessAppender.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/log4j/test/JU_Log4jAccessAppender.java
new file mode 100644
index 0000000..2c5d86b
--- /dev/null
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/log4j/test/JU_Log4jAccessAppender.java
@@ -0,0 +1,112 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 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.auth.log4j.test;
+
+import static org.junit.Assert.assertFalse;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+import java.util.Date;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggingEvent;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.log4j.Log4JAccessAppender;
+import org.onap.aaf.cadi.Access;
+
+public class JU_Log4jAccessAppender {
+
+	@Mock
+	Access access;
+	
+	@Before
+	public void setUp() {
+		initMocks(this);
+	}
+	
+	@Test
+	public void testRequiresLayout() {
+		Log4JAccessAppender log4jObj = new Log4JAccessAppender(access);
+		boolean retObj = log4jObj.requiresLayout();
+		assertFalse(retObj);
+	}
+	
+	@Test
+	public void testClose() {
+		Log4JAccessAppender log4jObj = new Log4JAccessAppender(access);
+		log4jObj.close();
+		
+	}
+	
+	@Test
+	public void testAppend() {
+		Log4jAccessAppenderImpl log4jObj = new Log4jAccessAppenderImpl(access);
+		LoggingEvent event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.FATAL,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+		Mockito.doReturn(true).when(access).willLog(Access.Level.ERROR);
+		event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.ERROR,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+		event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.ALL,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+	}
+	
+	@Test
+	public void testAppendWARN() {
+		Log4jAccessAppenderImpl log4jObj = new Log4jAccessAppenderImpl(access);
+		Mockito.doReturn(false).when(access).willLog(Access.Level.WARN);
+		LoggingEvent event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.WARN,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+	}
+	
+	@Test
+	public void testAppendINFO() {
+		Log4jAccessAppenderImpl log4jObj = new Log4jAccessAppenderImpl(access);
+		Mockito.doReturn(true).when(access).willLog(Access.Level.INFO);
+		LoggingEvent event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.INFO,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+	}
+	
+	@Test
+	public void testAppendWTrace() {
+		Log4jAccessAppenderImpl log4jObj = new Log4jAccessAppenderImpl(access);
+		Mockito.doReturn(false).when(access).willLog(Access.Level.TRACE);
+		LoggingEvent event=new LoggingEvent("com.chililog.server.engine",Logger.getLogger(Log4JAccessAppender.class),(new Date()).getTime(),Level.TRACE,"test",Thread.currentThread().getName(),null,null,null,null);
+		log4jObj.append(event);
+	}
+	
+	class Log4jAccessAppenderImpl extends Log4JAccessAppender{
+
+		public Log4jAccessAppenderImpl(Access access) {
+			super(access);
+			// TODO Auto-generated constructor stub
+		}
+		
+		@Override
+		protected void append(LoggingEvent event) {
+			super.append(event);
+		}
+		
+	}
+}
diff --git a/cadi/servlet-sample/pom.xml b/cadi/servlet-sample/pom.xml
index c792244..ec73e2f 100644
--- a/cadi/servlet-sample/pom.xml
+++ b/cadi/servlet-sample/pom.xml
@@ -10,6 +10,26 @@
 	<name>CADI Servlet Sample (Test Only)</name>
 	<artifactId>aaf-cadi-servlet-sample</artifactId>
 	<packaging>jar</packaging>
+	
+	<properties>
+		<!-- SONAR -->
+		<sonar.skip>true</sonar.skip>
+		<jacoco.version>0.7.7.201606060606</jacoco.version>
+		<sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
+		<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
+		<!-- Default Sonar configuration -->
+		<sonar.jacoco.reportPaths>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPaths>
+		<sonar.jacoco.itReportPaths>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPaths>
+		<!-- Note: This list should match jacoco-maven-plugin's exclusion list 
+			below -->
+		<sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
+		<nexusproxy>https://nexus.onap.org</nexusproxy>
+		<snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
+		<releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
+		<stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
+		<sitePath>/content/sites/site/org/onap/aaf/authz/${project.artifactId}/${project.version}</sitePath>
+		<project.bouncyCastleVersion>1.60</project.bouncyCastleVersion>
+	</properties>
 	<dependencies>
 	 	<!-- needs to be first to avoid jar signer implications for servlet api  -->
 		<dependency>
