diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java
index bedc212..650713c 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java
@@ -1096,55 +1096,6 @@
 				return;
 			}
 		}
-		//This would occur if we received a notification of a policy rename from AC
-		String oldPolicyName = request.getParameter("oldPolicyName");
-		String newPolicyName = request.getParameter("newPolicyName");
-		if(oldPolicyName != null && newPolicyName != null){
-			if(LOGGER.isDebugEnabled()){
-				LOGGER.debug("\nXACMLPapServlet.doPut() - before decoding"
-						+ "\npolicyToCreateUpdate = " + " ");
-			}
-			//decode it
-			try{
-				oldPolicyName = URLDecoder.decode(oldPolicyName, "UTF-8");
-				newPolicyName = URLDecoder.decode(newPolicyName, "UTF-8");
-				if(LOGGER.isDebugEnabled()){
-					LOGGER.debug("\nXACMLPapServlet.doPut() - after decoding"
-							+ "\npolicyToCreateUpdate = " + " ");
-				}
-			} catch(UnsupportedEncodingException e){
-				PolicyLogger.error("\nXACMLPapServlet.doPut() - Unsupported URL encoding of policyToCreateUpdate (UTF-8)"
-						+ "\npolicyToCreateUpdate = " + " ");
-				setResponseError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"policyToCreateUpdate encoding not supported"
-						+ "\nfailure with the following exception: " + e);
-				loggingContext.transactionEnded();
-				PolicyLogger.audit("Transaction Failed - See error.log");
-				im.endTransaction();
-				return;
-			}
-			//send it to PolicyDBDao
-			PolicyDBDaoTransaction renameTransaction = policyDBDao.getNewTransaction();
-			try{
-				renameTransaction.renamePolicy(oldPolicyName,newPolicyName, "XACMLPapServlet.doPut");
-			}catch(Exception e){
-				renameTransaction.rollbackTransaction();
-				setResponseError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"createUpdateTransaction.createPolicy(policyToCreateUpdate, XACMLPapServlet.doPut) "
-						+ "\nfailure with the following exception: " + e);
-				loggingContext.transactionEnded();
-				PolicyLogger.audit("Transaction Failed - See error.log");
-				im.endTransaction();
-				return;
-			}
-			loggingContext.metricStarted();
-			renameTransaction.commitTransaction();
-			loggingContext.metricEnded();
-			PolicyLogger.metrics("XACMLPapServlet goPut commitTransaction");
-			response.setStatus(HttpServletResponse.SC_OK);
-			loggingContext.transactionEnded();
-			PolicyLogger.audit("Transaction Ended Successfully");
-			im.endTransaction();
-			return;
-		}
 		//
 		// See if this is Admin Console registering itself with us
 		//
@@ -2274,33 +2225,6 @@
 	 * @throws IOException
 	 */
 	private void doACDelete(HttpServletRequest request, HttpServletResponse response, String groupId, ONAPLoggingContext loggingContext) throws IOException {
-		//This code is to allow deletes to propagate to the database since delete is not implemented
-		String isDeleteNotify = request.getParameter("isDeleteNotify");
-		if(isDeleteNotify != null){
-			String policyToDelete = request.getParameter("policyToDelete");
-			try{
-				policyToDelete = URLDecoder.decode(policyToDelete,"UTF-8");
-			} catch(UnsupportedEncodingException e){
-				LOGGER.error("Unsupported URL encoding of policyToDelete (UTF-8", e);
-				setResponseError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"policyToDelete encoding not supported");
-				return;
-			}
-			PolicyDBDaoTransaction deleteTransaction = policyDBDao.getNewTransaction();
-			try{
-				deleteTransaction.deletePolicy(policyToDelete);
-			} catch(Exception e){
-				deleteTransaction.rollbackTransaction();
-				setResponseError(response,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"deleteTransaction.deleteTransaction(policyToDelete) "
-						+ "\nfailure with the following exception: " + e);
-				return;
-			}
-			loggingContext.metricStarted();
-			deleteTransaction.commitTransaction();
-			loggingContext.metricEnded();
-			PolicyLogger.metrics("XACMLPapServlet doACPut commitTransaction");
-			response.setStatus(HttpServletResponse.SC_OK);
-			return;
-		}
 		PolicyDBDaoTransaction removePdpOrGroupTransaction = policyDBDao.getNewTransaction();
 		try {
 			// for all DELETE operations the group must exist before the operation can be done
@@ -2881,7 +2805,7 @@
 				}
 			}
 			// remove any ACs that are no longer connected
-			if (disconnectedACs.size() > 0) {
+			if (!disconnectedACs.isEmpty()) {
 				adminConsoleURLStringList.removeAll(disconnectedACs);
 			}
 		}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java
index 2e2fa0d..91530c7 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/ActionPolicy.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -31,6 +31,17 @@
 import java.util.List;
 import java.util.Map;
 
+import org.onap.policy.common.logging.eelf.MessageCodes;
+import org.onap.policy.common.logging.eelf.PolicyLogger;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.rest.adapter.PolicyRestAdapter;
+import org.onap.policy.rest.dao.CommonClassDao;
+import org.onap.policy.rest.jpa.FunctionDefinition;
+import org.onap.policy.xacml.api.XACMLErrorConstants;
+
+import com.att.research.xacml.api.pap.PAPException;
+
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType;
@@ -45,21 +56,7 @@
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionsType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
-import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
-
-import org.onap.policy.pap.xacml.rest.XACMLPapServlet;
-import org.onap.policy.pap.xacml.rest.util.JPAUtils;
-import org.onap.policy.rest.adapter.PolicyRestAdapter;
-import org.onap.policy.rest.jpa.Datatype;
-import org.onap.policy.rest.jpa.FunctionDefinition;
-import org.onap.policy.xacml.api.XACMLErrorConstants;
-
-import com.att.research.xacml.api.pap.PAPException;
-
-import org.onap.policy.common.logging.eelf.MessageCodes;
-import org.onap.policy.common.logging.eelf.PolicyLogger;
-import org.onap.policy.common.logging.flexlogger.FlexLogger; 
-import org.onap.policy.common.logging.flexlogger.Logger; 
+import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; 
 
 public class ActionPolicy extends Policy {
     
@@ -90,7 +87,9 @@
     List<String> dynamicFieldOneRuleAlgorithms = new LinkedList<>();
     List<String> dynamicFieldTwoRuleAlgorithms = new LinkedList<>();
     
-    protected Map<String, String> dropDownMap = new HashMap<>();
+
+    
+    private CommonClassDao commonClassDao;
     
     private static boolean isAttribute = false;
     private synchronized static boolean getAttribute () {
@@ -102,11 +101,12 @@
         super();
     }
     
-    public ActionPolicy(PolicyRestAdapter policyAdapter){
+    public ActionPolicy(PolicyRestAdapter policyAdapter, CommonClassDao commonClassDao){
         this.policyAdapter = policyAdapter;
+        this.commonClassDao = commonClassDao;
     }
-    
-    @Override
+
+	@Override
     public Map<String, String> savePolicies() throws PAPException {
         
         Map<String, String> successMap = new HashMap<>();
@@ -210,23 +210,22 @@
             dynamicFieldFunctionRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmCombo();
             dynamicFieldOneRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmField1();
             dynamicFieldTwoRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmField2();
-            dropDownMap = createDropDownMap();
                         
             // Rule attributes are optional and dynamic so check and add them to condition.
-            if (dynamicLabelRuleAlgorithms != null && dynamicLabelRuleAlgorithms.size() > 0) {
+            if (dynamicLabelRuleAlgorithms != null && !dynamicLabelRuleAlgorithms.isEmpty()) {
                 boolean isCompound = false;
                 ConditionType condition = new ConditionType();
                 int index = dynamicFieldOneRuleAlgorithms.size() - 1;
 
                 for (String labelAttr : dynamicLabelRuleAlgorithms) {
                     // if the rule algorithm as a label means it is a compound
-                    if (dynamicFieldOneRuleAlgorithms.get(index).toString().equals(labelAttr)) {
+                    if (dynamicFieldOneRuleAlgorithms.get(index).equals(labelAttr)) {
                         ApplyType actionApply = new ApplyType();
 
-                        String selectedFunction = (String) dynamicFieldFunctionRuleAlgorithms.get(index).toString();
-                        String value1 = (String) dynamicFieldOneRuleAlgorithms.get(index).toString();
-                        String value2 = dynamicFieldTwoRuleAlgorithms.get(index).toString();
-                        actionApply.setFunctionId(dropDownMap.get(selectedFunction));
+                        String selectedFunction = dynamicFieldFunctionRuleAlgorithms.get(index).toString();
+                        String value1 = dynamicFieldOneRuleAlgorithms.get(index);
+                        String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
+                        actionApply.setFunctionId(getFunctionDefinitionId(selectedFunction));
                         actionApply.getExpression().add(new ObjectFactory().createApply(getInnerActionApply(value1)));
                         actionApply.getExpression().add(new ObjectFactory().createApply(getInnerActionApply(value2)));
                         condition.setExpression(new ObjectFactory().createApply(actionApply));
@@ -381,9 +380,9 @@
                 }
 
                 // Getting the values from the form.
-                String functionKey = dynamicFieldFunctionRuleAlgorithms.get(index).toString();
-                String value2 = dynamicFieldTwoRuleAlgorithms.get(index).toString();
-                actionApply.setFunctionId(dropDownMap.get(functionKey));
+                String functionKey = dynamicFieldFunctionRuleAlgorithms.get(index);
+                String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
+                actionApply.setFunctionId(getFunctionDefinitionId(functionKey));
                 // if two text field are rule attributes.
                 if ((value1.contains(RULE_VARIABLE)) && (value2.contains(RULE_VARIABLE))) {
                     ApplyType innerActionApply1 = new ApplyType();
@@ -463,10 +462,10 @@
     // if the rule algorithm is multiple compound one setting the apply
     protected ApplyType getCompoundApply(int index) {
         ApplyType actionApply = new ApplyType();
-        String selectedFunction = dynamicFieldFunctionRuleAlgorithms.get(index).toString();
-        String value1 = dynamicFieldOneRuleAlgorithms.get(index).toString();
-        String value2 = dynamicFieldTwoRuleAlgorithms.get(index).toString();
-        actionApply.setFunctionId(dropDownMap.get(selectedFunction));
+        String selectedFunction = dynamicFieldFunctionRuleAlgorithms.get(index);
+        String value1 = dynamicFieldOneRuleAlgorithms.get(index);
+        String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
+        actionApply.setFunctionId(getFunctionDefinitionId(selectedFunction));
         actionApply.getExpression().add(new ObjectFactory().createApply(getInnerActionApply(value1)));
         actionApply.getExpression().add(new ObjectFactory().createApply(getInnerActionApply(value2)));
         return actionApply;
@@ -485,32 +484,18 @@
         assignmentHeaders.setExpression(new ObjectFactory().createAttributeValue(headersAttributeValue));
         return assignmentHeaders;
     }
-    
-    private Map<String,String> createDropDownMap(){
-        JPAUtils jpaUtils = null;
-        Map<String, String> dropDownMap = new HashMap<>();
-        try {
-            jpaUtils = JPAUtils.getJPAUtilsInstance(XACMLPapServlet.getEmf());
-        } catch (Exception e) {
-            LOGGER.error("Exception Occured"+e);
-        }
-        if(jpaUtils != null){
-            Map<Datatype, List<FunctionDefinition>> functionMap = jpaUtils.getFunctionDatatypeMap();
-            
-            for (Datatype id : functionMap.keySet()) {
-                List<FunctionDefinition> functionDefinitions = (List<FunctionDefinition>) functionMap
-                        .get(id);
-                for (FunctionDefinition functionDef : functionDefinitions) {
-                    dropDownMap.put(functionDef.getShortname(),functionDef.getXacmlid());
-                }
-            }
-        }
-        return dropDownMap;
-    }
 
     @Override
     public Object getCorrectPolicyDataObject() {
         return policyAdapter.getPolicyData();
     }
+    
+    public String getFunctionDefinitionId(String key){
+    	FunctionDefinition object = (FunctionDefinition) commonClassDao.getDataById(FunctionDefinition.class, "short_name", key);
+    	if(object != null){
+    		return object.getXacmlid();
+    	}
+    	return null;
+    }
 
 }
\ No newline at end of file
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
index 22d2da3..56c23ac 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicy.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -53,9 +53,8 @@
 import org.onap.policy.controlloop.policy.guard.MatchParameters;
 import org.onap.policy.controlloop.policy.guard.builder.ControlLoopGuardBuilder;
 import org.onap.policy.pap.xacml.rest.XACMLPapServlet;
-import org.onap.policy.pap.xacml.rest.util.JPAUtils;
 import org.onap.policy.rest.adapter.PolicyRestAdapter;
-import org.onap.policy.rest.jpa.Datatype;
+import org.onap.policy.rest.dao.CommonClassDao;
 import org.onap.policy.rest.jpa.DecisionSettings;
 import org.onap.policy.rest.jpa.FunctionDefinition;
 import org.onap.policy.utils.PolicyUtils;
@@ -108,15 +107,15 @@
 	List<String> dynamicFieldTwoRuleAlgorithms = new LinkedList<>();
 	List<String> dataTypeList = new LinkedList<>();
 	
-	protected Map<String, String> dropDownMap = new HashMap<>();
+	private CommonClassDao commonClassDao;
 	
-
 	public DecisionPolicy() {
 		super();
 	}
 	
-	public DecisionPolicy(PolicyRestAdapter policyAdapter){
+	public DecisionPolicy(PolicyRestAdapter policyAdapter, CommonClassDao commonClassDao){
 		this.policyAdapter = policyAdapter;
+		this.commonClassDao = commonClassDao;
 	}
 	
 	@Override
@@ -419,7 +418,6 @@
 		dynamicFieldComboRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmCombo();
 		dynamicFieldOneRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmField1();
 		dynamicFieldTwoRuleAlgorithms = policyAdapter.getDynamicRuleAlgorithmField2();
-		dropDownMap = createDropDownMap();
 		
 		if(policyAdapter.getRuleProvider()!=null && policyAdapter.getRuleProvider().equals(AAFPROVIDER)){
 			// Values for AAF Provider are here for XML Creation. 
@@ -494,7 +492,7 @@
 					String selectedFunction = dynamicFieldComboRuleAlgorithms.get(index);
 					String value1 = dynamicFieldOneRuleAlgorithms.get(index);
 					String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
-					decisionApply.setFunctionId(dropDownMap.get(selectedFunction));
+					decisionApply.setFunctionId(getFunctionDefinitionId(selectedFunction));
 					decisionApply.getExpression().add(new ObjectFactory().createApply(getInnerDecisionApply(value1)));
 					decisionApply.getExpression().add(new ObjectFactory().createApply(getInnerDecisionApply(value2)));
 					condition.setExpression(new ObjectFactory().createApply(decisionApply));
@@ -633,7 +631,7 @@
 				// Getting the values from the form.
 				String functionKey = dynamicFieldComboRuleAlgorithms.get(index);
 				String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
-				decisionApply.setFunctionId(dropDownMap.get(functionKey));
+				decisionApply.setFunctionId(getFunctionDefinitionId(functionKey));
 				// if two text field are rule attributes.
 				if ((value1.contains(RULE_VARIABLE)) && (value2.contains(RULE_VARIABLE))) {
 					ApplyType innerDecisionApply1 = new ApplyType();
@@ -721,7 +719,7 @@
 		String selectedFunction = dynamicFieldComboRuleAlgorithms.get(index);
 		String value1 = dynamicFieldOneRuleAlgorithms.get(index);
 		String value2 = dynamicFieldTwoRuleAlgorithms.get(index);
-		decisionApply.setFunctionId(dropDownMap.get(selectedFunction));
+		decisionApply.setFunctionId(getFunctionDefinitionId(selectedFunction));
 		decisionApply.getExpression().add(new ObjectFactory().createApply(getInnerDecisionApply(value1)));
 		decisionApply.getExpression().add(new ObjectFactory().createApply(getInnerDecisionApply(value2)));
 		return decisionApply;
@@ -760,24 +758,6 @@
 		dataTypeList.add(dataType);
 	}
 	
-	private Map<String,String> createDropDownMap(){
-		JPAUtils jpaUtils = null;
-		try {
-			jpaUtils = JPAUtils.getJPAUtilsInstance(XACMLPapServlet.getEmf());
-		} catch (Exception e) {
-			LOGGER.error("Exception Occured"+e);
-		}
-		Map<String, String> dropDownOptions = new HashMap<>();
-		if(jpaUtils!=null){
-			Map<Datatype, List<FunctionDefinition>> functionMap = jpaUtils.getFunctionDatatypeMap();
-			for (Map.Entry<Datatype,List<FunctionDefinition>> map: functionMap.entrySet()) {
-				for (FunctionDefinition functionDef : map.getValue()) {
-					dropDownOptions.put(functionDef.getShortname(),functionDef.getXacmlid());
-				}
-			}
-		}
-		return dropDownOptions;
-	}
 	
 	private String getDataType(String key) {
 		
@@ -800,4 +780,12 @@
 		return policyAdapter.getData();
 	}
 	
+	public String getFunctionDefinitionId(String key){
+    	FunctionDefinition object = (FunctionDefinition) commonClassDao.getDataById(FunctionDefinition.class, "short_name", key);
+    	if(object != null){
+    		return object.getXacmlid();
+    	}
+    	return null;
+    }
+	
 }
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
index 568830f..2fb6367 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
@@ -28,7 +28,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.ProtocolException;
@@ -39,9 +38,6 @@
 import java.nio.file.InvalidPathException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.security.InvalidKeyException;
-import java.security.Key;
-import java.security.NoSuchAlgorithmException;
 import java.util.Base64;
 import java.util.Date;
 import java.util.HashMap;
@@ -53,11 +49,6 @@
 import java.util.Set;
 import java.util.UUID;
 
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.spec.SecretKeySpec;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.LockModeType;
@@ -69,10 +60,8 @@
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathFactory;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
-import org.elasticsearch.common.Strings;
 import org.onap.policy.common.logging.eelf.MessageCodes;
 import org.onap.policy.common.logging.eelf.PolicyLogger;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
@@ -88,14 +77,12 @@
 import org.onap.policy.rest.jpa.PdpEntity;
 import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
 import org.onap.policy.rest.jpa.PolicyEntity;
-import org.onap.policy.rest.util.Webapps;
 import org.onap.policy.utils.CryptoUtils;
 import org.onap.policy.xacml.api.pap.OnapPDP;
 import org.onap.policy.xacml.api.pap.OnapPDPGroup;
 import org.onap.policy.xacml.api.pap.PAPPolicyEngine;
 import org.onap.policy.xacml.std.pap.StdPDPGroup;
 import org.onap.policy.xacml.std.pap.StdPDPPolicy;
-import org.onap.policy.xacml.util.XACMLPolicyScanner;
 import org.onap.policy.xacml.util.XACMLPolicyWriter;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
@@ -119,6 +106,32 @@
 	public static final String PROPERTIES_CONFIG = "PROPERTIES";
 	public static final String OTHER_CONFIG = "OTHER";
 	public static final String AUDIT_USER = "audit";
+	
+	//Declared to static variables which were repeating multiple times across the PolicyDBDao
+	public static final String config = "Config";
+	public static final String action = "Action";
+	public static final String groupIdVar = "groupId";
+	public static final String deletedVar = "deleted";
+	public static final String groupEntitySelectQuery = "SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted";
+	public static final String pdpEntitySelectQuery = "SELECT p FROM PdpEntity p WHERE p.pdpId=:pdpId AND p.deleted=:deleted";
+	public static final String groupCannotBeFound = "The group could not be found with id ";
+	public static final String foundInDBNotDeleted = " were found in the database that are not deleted";
+	public static final String moreThanOnePDP = "Somehow, more than one pdp with the same id ";
+	public static final String deletedStatusFound = " and deleted status were found in the database";
+	public static final String duplicateGroupId = "Somehow, more than one group with the same id ";
+	public static final String pdpIdVariable = "pdpId";
+	public static final String queryFailedToCheckExisting = "Query failed trying to check for existing group";
+	public static final String queryFailedToGetGroup = "Query failed trying to get group ";
+	public static final String scope = "scope";
+	public static final String policyDBDaoVar = "PolicyDBDao";
+	public static final String duplicatePolicyId = "Somehow, more than one policy with the id ";
+	public static final String foundInDB = " were found in the database";
+	
+	public static boolean isJunit = false;
+
+	public static void setJunit(boolean isJunit) {
+		PolicyDBDao.isJunit = isJunit;
+	}
 
 	/**
 	 * Get an instance of a PolicyDBDao. It creates one if it does not exist.
@@ -151,9 +164,11 @@
 		}
 		throw new IllegalStateException("The PolicyDBDao.currentInstance is Null.  Use getPolicyDBDao(EntityManagerFactory emf)");
 	}
+	
 	public void setPapEngine(PAPPolicyEngine papEngine2){
-		this.papEngine = (PAPPolicyEngine) papEngine2;
+		this.papEngine = papEngine2;
 	}
+	
 	private PolicyDBDao(EntityManagerFactory emf){
 		logger.debug("PolicyDBDao(EntityManagerFactory emf) as PolicyDBDao("+emf+") called");
 		this.emf = emf;
@@ -223,7 +238,7 @@
 			policyDBDaoEntityList = getPolicyDBDaoEntityQuery.getResultList();
 
 		} catch(Exception e){
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Exception querying for other registered PolicyDBDaos");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Exception querying for other registered PolicyDBDaos");
 			logger.warn("List of remote PolicyDBDaos will be empty", e);
 		}
 		try{
@@ -242,7 +257,7 @@
 
 	public PolicyDBDaoTransaction getNewTransaction(){
 		logger.debug("getNewTransaction() as getNewTransaction() called");
-		return (PolicyDBDaoTransaction)(new PolicyDBDaoTransactionInstance());
+		return new PolicyDBDaoTransactionInstance();
 	}
 
 	/*
@@ -257,7 +272,7 @@
 		int auditWaitMs = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_TRANS_WAIT));
 		//Use the (extended) audit timeout time in ms
 		int auditTimeoutMs = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_AUDIT_TIMEOUT)); 
-		return (PolicyDBDaoTransaction)(new PolicyDBDaoTransactionInstance(auditTimeoutMs, auditWaitMs));
+		return new PolicyDBDaoTransactionInstance(auditTimeoutMs, auditWaitMs);
 	}
 
 
@@ -278,27 +293,6 @@
 	}
 
 	/**
-	 * Computes the scope in dotted format based on an absolute path and a path that divides the scope.
-	 * @param fullPath An absolute path including scope folders and other folders(does not have to be absolute, must just contain scope and other folders before)
-	 * @param pathToExclude The path that acts as a division between the scope and the other folders
-	 * @return The scope in dotted format (org.onap)
-	 */
-	private static String computeScope(String fullPath, String pathToExclude){
-		logger.debug("computeScope(String fullPath, String pathToExclude) as computeScope("+fullPath+", "+pathToExclude+") called");
-		int excludeIndex = fullPath.indexOf(pathToExclude);
-		String scopePath = fullPath.substring(excludeIndex+pathToExclude.length());
-		String scope = scopePath.replace('\\', '.');
-		scope = scope.replace('/', '.');
-		if(scope.charAt(0) == '.'){
-			scope = scope.substring(1);
-		}
-		if(scope.charAt(scope.length()-1) == '.'){
-			scope = scope.substring(0, scope.length()-1);
-		}
-		return scope;
-	}
-
-	/**
 	 * Returns the url of this local pap server, removing the username and password, if they are present
 	 * @return The url of this local pap server
 	 */
@@ -309,9 +303,8 @@
 			return null;
 		}
 		return splitPapUrlUserPass(url);
-
-
 	}
+	
 	private String[] splitPapUrlUserPass(String url){
 		String[] urlUserPass = new String[3];
 		String[] commaSplit = url.split(",");
@@ -320,14 +313,14 @@
 			urlUserPass[1] = commaSplit[1];
 			urlUserPass[2] = commaSplit[2];
 		}
-		if(urlUserPass[1] == null || urlUserPass[1].equals("")){
+		if(urlUserPass[1] == null || "".equals(urlUserPass[1])){
 			String usernamePropertyValue = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID);
 			if(usernamePropertyValue != null){
 				urlUserPass[1] = usernamePropertyValue;
 			}
 		}
-		if(urlUserPass[2] == null || urlUserPass[2].equals("")){
-			String passwordPropertyValue = CryptoUtils.decryptTxtNoExStr(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS));
+		if(urlUserPass[2] == null || "".equals(urlUserPass[2])){
+			String passwordPropertyValue = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS);
 			if(passwordPropertyValue != null){
 				urlUserPass[2] = passwordPropertyValue;
 			}
@@ -335,7 +328,7 @@
 		//if there is no comma, for some reason there is no username and password, so don't try to cut them off
 		return urlUserPass;
 	}
-
+	
 	/**
 	 * Register the PolicyDBDao instance in the PolicyDBDaoEntity table
 	 * @return Boolean, were we able to register?
@@ -347,7 +340,6 @@
 		if(url == null || url.length<3){			
 			return false;
 		}
-		
 		EntityManager em = emf.createEntityManager();
 		try{
 			startTransactionSynced(em, 1000);
@@ -364,7 +356,7 @@
 					em.getTransaction().commit();
 					em.close();					
 				} catch(Exception e2){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "COULD NOT CREATE DATABASELOCK ROW.  WILL TRY ONE MORE TIME");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, policyDBDaoVar, "COULD NOT CREATE DATABASELOCK ROW.  WILL TRY ONE MORE TIME");
 				}
 				em = null;
 				em = emf.createEntityManager();
@@ -372,7 +364,7 @@
 					startTransactionSynced(em, 1000);
 				} catch(Exception e3){
 					String msg = "DATABASE LOCKING NOT WORKING. CONCURRENCY CONTROL NOT WORKING";
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e3, "PolicyDBDao", msg);
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e3, policyDBDaoVar, msg);
 					throw new IllegalStateException("msg" + "\n" + e3);
 				}
 			}
@@ -387,7 +379,7 @@
 			txt = CryptoUtils.encryptTxt(url[2].getBytes(StandardCharsets.UTF_8));
 		} catch(Exception e){
 			logger.debug(e);
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Could not encrypt PAP password");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Could not encrypt PAP password");
 		}
 		if(foundPolicyDBDaoEntity == null){
 			PolicyDBDaoEntity newPolicyDBDaoEntity = new PolicyDBDaoEntity();
@@ -396,7 +388,6 @@
 			newPolicyDBDaoEntity.setDescription("PAP server at "+url[0]);
 			newPolicyDBDaoEntity.setUsername(url[1]);
 			newPolicyDBDaoEntity.setPassword(txt);
-			
 			try{
 				em.getTransaction().commit();
 			} catch(Exception e){
@@ -405,19 +396,17 @@
 					em.getTransaction().rollback();
 				} catch(Exception e2){
 					logger.debug(e2);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "Could not add new PolicyDBDao to the database");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, policyDBDaoVar, "Could not add new PolicyDBDao to the database");
 				}
 			}
 		} else {
 			//just want to update in order to change modified date
-			
 			if(url[1] != null && !stringEquals(url[1], foundPolicyDBDaoEntity.getUsername())){
 				foundPolicyDBDaoEntity.setUsername(url[1]);
 			}
 			if(txt != null && !stringEquals(txt, foundPolicyDBDaoEntity.getPassword())){
 				foundPolicyDBDaoEntity.setPassword(txt);
 			}
-			
 			foundPolicyDBDaoEntity.preUpdate();
 			try{
 				em.getTransaction().commit();
@@ -427,7 +416,7 @@
 					em.getTransaction().rollback();
 				} catch(Exception e2){
 					logger.debug(e2);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "Could not update PolicyDBDao in the database");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, policyDBDaoVar, "Could not update PolicyDBDao in the database");
 				}
 			}
 		}
@@ -435,22 +424,20 @@
 		logger.debug("\nPolicyDBDao.register(). Success!!\n");
 		return true;
 	}
+	
 	public void notifyOthers(long entityId,String entityType){
 		notifyOthers(entityId,entityType,null);
 	}
+	
 	public void notifyOthers(long entityId, String entityType, String newGroupId){
 		logger.debug("notifyOthers(long entityId, String entityType, long newGroupId) as notifyOthers("+entityId+","+entityType+","+newGroupId+") called");		
 		LinkedList<Thread> notifyThreads = new LinkedList<>();
 
 		//we're going to run notifications in parallel threads to speed things up
 		for(Object obj : otherServers){
-
 			Thread newNotifyThread = new Thread(new NotifyOtherThread(obj, entityId, entityType, newGroupId));
-
 			newNotifyThread.start();
-
 			notifyThreads.add(newNotifyThread);
-
 		}
 		//we want to wait for all notifications to complete or timeout before we unlock the interface and allow more changes
 		for(Thread t : notifyThreads){
@@ -460,8 +447,6 @@
 				logger.warn("Could not join a notifcation thread" + e);
 			}
 		}
-
-
 	}
 
 	private class NotifyOtherThread implements Runnable {
@@ -489,7 +474,6 @@
 				//if we can't decrypt, might as well try it anyway
 				txt = dbdEntity.getPassword();
 			}
-			
 			Base64.Encoder encoder = Base64.getEncoder();			
 			String encoding = encoder.encodeToString((username+":"+txt).getBytes(StandardCharsets.UTF_8));
 			HttpURLConnection connection = null;
@@ -513,13 +497,13 @@
 					o = "undefined";
 				}
 				if(papUrl.equals(ourUrl)){
-					logger.debug(((String)o)+" is our url, skipping notify");
+					logger.debug(o+" is our url, skipping notify");
 					return;
 				}
 				if(newGroupId == null){
-					url = new URL(((String)o)+"?policydbdaourl="+papUrl+"&entityid="+entityId+"&entitytype="+entityType);
+					url = new URL(o+"?policydbdaourl="+papUrl+"&entityid="+entityId+"&entitytype="+entityType);
 				} else {
-					url = new URL(((String)o)+"?policydbdaourl="+papUrl+"&entityid="+entityId+"&entitytype="+entityType+"&extradata="+newGroupId);
+					url = new URL(o+"?policydbdaourl="+papUrl+"&entityid="+entityId+"&entitytype="+entityType+"&extradata="+newGroupId);
 				}
 			} catch (MalformedURLException e) {
 				logger.warn("Caught MalformedURLException on: new URL()", e);
@@ -553,7 +537,6 @@
 			int readTimeout;
 			try{
 				readTimeout = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_NOTIFY_TIMEOUT));
-
 			} catch(Exception e){
 				logger.error("xacml.rest.pap.notify.timeoutms property not set, using a default.", e);
 				readTimeout = 10000;
@@ -587,7 +570,6 @@
 				logger.warn("Caught Exception on: connection.getResponseCode() ", e);
 			}
 
-
 			connection.disconnect();
 		}
 	}
@@ -603,28 +585,17 @@
 
 			XPathFactory xpathFactory = XPathFactory.newInstance();
 			XPath xpath = xpathFactory.newXPath();
-
-
+			
 			description = xpath.evaluate(expression, document);		
 		}catch(Exception e){
 			logger.error("Exception Occured while evaluating path"+e);
 		}
-
 		return description;
 	}
-
-	private static String getDescriptionFromXacml(String xacmlData){
-		String openTag = "<Description>";
-		String closeTag = "</Description>";
-		int descIndex = xacmlData.indexOf(openTag);
-		int endDescIndex = xacmlData.indexOf(closeTag);
-		String desc = xacmlData.substring(descIndex+openTag.length(),endDescIndex);
-		return desc;
-	}
 	
-	private final String POLICY_NOTIFICATION = "policy";
-	private final String PDP_NOTIFICATION = "pdp";
-	private final String GROUP_NOTIFICATION = "group";
+	private static final String POLICY_NOTIFICATION = "policy";
+	private static final String PDP_NOTIFICATION = "pdp";
+	private static final String GROUP_NOTIFICATION = "group";
 	public void handleIncomingHttpNotification(String url, String entityId, String entityType, String extraData, XACMLPapServlet xacmlPapServlet){
 		logger.info("DBDao url: " + url + " has reported an update on "+entityType+" entity "+entityId);		
 		PolicyDBDaoTransaction transaction = this.getNewTransaction();
@@ -632,7 +603,6 @@
 		int retries;
 		try{
 			retries = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_INCOMINGNOTIFICATION_TRIES));
-
 		} catch(Exception e){
 			logger.error("xacml.rest.pap.incomingnotification.tries property not set, using a default of 3."+e);
 			retries = 3;
@@ -647,11 +617,11 @@
 		case POLICY_NOTIFICATION:
 			for(int i=0; i<retries;i++){
 				try{
-					handleIncomingPolicyChange(url, entityId,extraData);
+					handleIncomingPolicyChange(entityId);
 					break;
 				} catch(Exception e){
 					logger.debug(e);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught exception on handleIncomingPolicyChange("+url+", "+entityId+", "+extraData+")");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught exception on handleIncomingPolicyChange("+url+", "+entityId+", "+extraData+")");
 				}
 				try{
 					Thread.sleep(pauseBetweenRetries);
@@ -664,11 +634,11 @@
 		case PDP_NOTIFICATION:
 			for(int i=0; i<retries;i++){
 				try{
-					handleIncomingPdpChange(url, entityId, transaction);
+					handleIncomingPdpChange(entityId, transaction);
 					break;
 				} catch(Exception e){
 					logger.debug(e);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught exception on handleIncomingPdpChange("+url+", "+entityId+", "+transaction+")");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught exception on handleIncomingPdpChange("+url+", "+entityId+", "+transaction+")");
 				}
 				try{
 					Thread.sleep(pauseBetweenRetries);
@@ -681,11 +651,11 @@
 		case GROUP_NOTIFICATION:
 			for(int i=0; i<retries;i++){
 				try{
-					handleIncomingGroupChange(url, entityId, extraData, transaction, xacmlPapServlet);
+					handleIncomingGroupChange(entityId, extraData, transaction);
 					break;
 				}catch(Exception e){
 					logger.debug(e);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught exception on handleIncomingGroupChange("+url+", "+entityId+", "+extraData+", "+transaction+", "+xacmlPapServlet+")");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught exception on handleIncomingGroupChange("+url+", "+entityId+", "+extraData+", "+transaction+", "+xacmlPapServlet+")");
 				}
 				try{
 					Thread.sleep(pauseBetweenRetries);
@@ -699,7 +669,8 @@
 		//no changes should be being made in this function, we still need to close
 		transaction.rollbackTransaction();
 	}
-	private void handleIncomingGroupChange(String url, String groupId, String extraData,PolicyDBDaoTransaction transaction,XACMLPapServlet xacmlPapServlet) throws PAPException, PolicyDBException{
+	
+	private void handleIncomingGroupChange(String groupId, String extraData,PolicyDBDaoTransaction transaction) throws PAPException, PolicyDBException{
 		GroupEntity groupRecord = null;
 		long groupIdLong = -1;
 		try{
@@ -710,7 +681,7 @@
 		try{
 			groupRecord = transaction.getGroup(groupIdLong);
 		} catch(Exception e){
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get pdp group record with transaction.getGroup("+groupIdLong+");");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get pdp group record with transaction.getGroup("+groupIdLong+");");
 			throw new PAPException("Could not get local group "+groupIdLong);
 		}
 		if(groupRecord == null){
@@ -738,13 +709,13 @@
 				try {
 					newLocalGroup = papEngine.getGroup(extraData);
 				} catch (PAPException e) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to get new pdp group with papEngine.getGroup("+extraData+");");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to get new pdp group with papEngine.getGroup("+extraData+");");
 				}
 			}
 			try {
 				papEngine.removeGroup(localGroup, newLocalGroup);
 			} catch (NullPointerException | PAPException e) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to get remove pdp group with papEngine.removeGroup("+localGroup+", "+newLocalGroup+");");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to get remove pdp group with papEngine.removeGroup("+localGroup+", "+newLocalGroup+");");
 				throw new PAPException("Could not remove group "+groupId);
 			}
 		}
@@ -753,13 +724,13 @@
 			try {
 				papEngine.newGroup(groupRecord.getgroupName(), groupRecord.getDescription());
 			} catch (NullPointerException | PAPException e) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to create pdp group with papEngine.newGroup(groupRecord.getgroupName(), groupRecord.getDescription());");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to create pdp group with papEngine.newGroup(groupRecord.getgroupName(), groupRecord.getDescription());");
 				throw new PAPException("Could not create group "+groupRecord);
 			}
 			try {
 				localGroup = papEngine.getGroup(groupRecord.getGroupId());
 			} catch (PAPException e1) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, "PolicyDBDao", "Caught PAPException trying to get pdp group we just created with papEngine.getGroup(groupRecord.getGroupId());\nAny PDPs or policies in the new group may not have been added");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, policyDBDaoVar, "Caught PAPException trying to get pdp group we just created with papEngine.getGroup(groupRecord.getGroupId());\nAny PDPs or policies in the new group may not have been added");
 				return;
 			}
 			//add possible pdps to group
@@ -769,7 +740,7 @@
 				try {
 					papEngine.newPDP(pdp.getPdpId(), localGroup, pdp.getPdpName(), pdp.getDescription(), pdp.getJmxPort());
 				} catch (NullPointerException | PAPException e) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to get create pdp with papEngine.newPDP(pdp.getPdpId(), localGroup, pdp.getPdpName(), pdp.getDescription(), pdp.getJmxPort());");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to get create pdp with papEngine.newPDP(pdp.getPdpId(), localGroup, pdp.getPdpName(), pdp.getDescription(), pdp.getJmxPort());");
 					throw new PAPException("Could not create pdp "+pdp);
 				}
 			}
@@ -791,7 +762,7 @@
 					papEngine.setDefaultGroup(localGroup);
 					return;
 				} catch (PAPException e) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to set default group with papEngine.SetDefaultGroup("+localGroupClone+");");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to set default group with papEngine.SetDefaultGroup("+localGroupClone+");");
 					throw new PAPException("Could not set default group to "+localGroupClone);
 				}				
 			}		
@@ -811,17 +782,15 @@
 			}
 			if(needToUpdate){
 				try {
-
 					papEngine.updateGroup(localGroupClone);
 				} catch (PAPException e) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to update group with papEngine.updateGroup("+localGroupClone+");");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to update group with papEngine.updateGroup("+localGroupClone+");");
 					throw new PAPException("Could not update group "+localGroupClone);
 				}
 			}				
-
 		}
-		//call command that corresponds to the change that was made
 	}
+	
 	//this will also handle removes, since incoming pdpGroup has no policies internally, we are just going to add them all in from the db
 	private boolean updateGroupPoliciesInFileSystem(OnapPDPGroup pdpGroup,OnapPDPGroup oldPdpGroup, GroupEntity groupRecord, PolicyDBDaoTransaction transaction) throws PAPException, PolicyDBException{
 		if(!(pdpGroup instanceof StdPDPGroup)){
@@ -830,7 +799,7 @@
 		StdPDPGroup group = (StdPDPGroup)pdpGroup;
 		//this must always be true since we don't explicitly know when a delete is occuring
 		boolean didUpdate = true;
-		HashMap<String,PDPPolicy> currentPolicySet = new HashMap<String,PDPPolicy>(oldPdpGroup.getPolicies().size());
+		HashMap<String,PDPPolicy> currentPolicySet = new HashMap<>(oldPdpGroup.getPolicies().size());
 		HashSet<PDPPolicy> newPolicySet = new HashSet<>();
 		for(PDPPolicy pdpPolicy : oldPdpGroup.getPolicies()){
 			currentPolicySet.put(pdpPolicy.getId(), pdpPolicy);
@@ -861,7 +830,6 @@
 			group.setPolicies(newPolicySet);
 		}
 		return didUpdate;
-
 	}
 	
 	/*
@@ -885,11 +853,9 @@
 			if(currentPolicyMap.containsKey(pdpPolicyId)){
 				newPolicySet.add(currentPolicyMap.get(pdpPolicyId));
 			} else {
-				
 				//convert PolicyEntity object to PDPPolicy
-				String name = null;
-            	name = pdpPolicyId.replace(".xml", "");
-            	name = name.substring(0, name.lastIndexOf("."));
+            	String name = pdpPolicyId.replace(".xml", "");
+            	name = name.substring(0, name.lastIndexOf('.'));
 				InputStream policyStream = new ByteArrayInputStream(policy.getPolicyData().getBytes());
 				pdpGroup.copyPolicyToFile(pdpPolicyId,name,policyStream);
 				URI location = Paths.get(pdpGroup.getDirectory().toAbsolutePath().toString(), pdpPolicyId).toUri();
@@ -901,9 +867,7 @@
 					logger.debug(e);
 					PolicyLogger.error("PolicyDBDao: Exception occurred while creating the StdPDPPolicy newPolicy object " + e.getMessage());
 				}
-				
 			}
-			
 		}
 
 		for(String id : currentPolicyMap.keySet()) {
@@ -957,7 +921,7 @@
         return nameAndVersion;
     }
     
-	private void handleIncomingPdpChange(String url, String pdpId, PolicyDBDaoTransaction transaction) throws PAPException{
+	private void handleIncomingPdpChange(String pdpId, PolicyDBDaoTransaction transaction) throws PAPException{
 		//get pdp
 		long pdpIdLong = -1;
 		try{
@@ -969,7 +933,7 @@
 		try{
 			pdpRecord = transaction.getPdp(pdpIdLong);
 		}catch(Exception e){
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get pdp record with transaction.getPdp("+pdpIdLong+");");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get pdp record with transaction.getPdp("+pdpIdLong+");");
 			throw new PAPException("Could not get local pdp "+pdpIdLong);
 		}
 		if(pdpRecord == null){
@@ -985,7 +949,7 @@
 			try {
 				papEngine.removePDP((OnapPDP) localPdp);
 			} catch (PAPException e) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to get remove pdp with papEngine.removePDP("+localPdp+");");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to get remove pdp with papEngine.removePDP("+localPdp+");");
 				throw new PAPException("Could not remove pdp "+pdpId);
 			}
 		}
@@ -996,13 +960,13 @@
 			try {
 				localGroup = papEngine.getGroup(pdpRecord.getGroup().getGroupId());
 			} catch (PAPException e1) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, "PolicyDBDao", "Caught PAPException trying to get local group to add pdp to with papEngine.getGroup(pdpRecord.getGroup().getGroupId());");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, policyDBDaoVar, "Caught PAPException trying to get local group to add pdp to with papEngine.getGroup(pdpRecord.getGroup().getGroupId());");
 				throw new PAPException("Could not get local group");
 			}			
 			try {
 				papEngine.newPDP(pdpRecord.getPdpId(), localGroup, pdpRecord.getPdpName(), pdpRecord.getDescription(), pdpRecord.getJmxPort());
 			} catch (NullPointerException | PAPException e) {
-				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to create pdp with papEngine.newPDP("+pdpRecord.getPdpId()+", "+localGroup+", "+pdpRecord.getPdpName()+", "+pdpRecord.getDescription()+", "+pdpRecord.getJmxPort()+");");
+				PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to create pdp with papEngine.newPDP("+pdpRecord.getPdpId()+", "+localGroup+", "+pdpRecord.getPdpName()+", "+pdpRecord.getDescription()+", "+pdpRecord.getJmxPort()+");");
 				throw new PAPException("Could not create pdp "+pdpRecord);
 			}
 		} else {
@@ -1029,13 +993,13 @@
 					newPdpGroup = papEngine.getGroup(pdpRecord.getGroup().getGroupId());
 				}catch(PAPException e){
 					//ok, now we have an issue. Time to stop things
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to get id of local group to move pdp to with papEngine.getGroup(pdpRecord.getGroup().getGroupId());");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to get id of local group to move pdp to with papEngine.getGroup(pdpRecord.getGroup().getGroupId());");
 					throw new PAPException("Could not get local group");
 				}
 				try{
 					papEngine.movePDP((OnapPDP) localPdp, newPdpGroup);
 				}catch(PAPException e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to move pdp with papEngine.movePDP(localPdp, newPdpGroup);");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to move pdp with papEngine.movePDP(localPdp, newPdpGroup);");
 					throw new PAPException("Could not move pdp "+localPdp);
 				}
 			}
@@ -1047,7 +1011,7 @@
 				try {
 					papEngine.updatePDP((OnapPDP) localPdp);
 				} catch (PAPException e) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PAPException trying to update pdp with papEngine.updatePdp("+localPdp+");");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PAPException trying to update pdp with papEngine.updatePdp("+localPdp+");");
 					throw new PAPException("Could not update pdp "+localPdp);
 				}
 			}
@@ -1055,7 +1019,7 @@
 		//compare to local situation
 		//call command to update
 	}
-	private void handleIncomingPolicyChange(String url, String policyId,String oldPathString){
+	private void handleIncomingPolicyChange(String policyId){
 		String policyName = null;
 		EntityManager em = emf.createEntityManager();
 		Query getPolicyEntityQuery = em.createNamedQuery("PolicyEntity.FindById");
@@ -1076,22 +1040,22 @@
 				Path subFile = null;
 
 				if (policy.getConfigurationData()!= null){
-					subFile = getPolicySubFile(policy.getConfigurationData().getConfigurationName(), "Config");
+					subFile = getPolicySubFile(policy.getConfigurationData().getConfigurationName(), config);
 				}else if(policy.getActionBodyEntity()!= null){
-					subFile = getPolicySubFile(policy.getActionBodyEntity().getActionBodyName(), "Action");
+					subFile = getPolicySubFile(policy.getActionBodyEntity().getActionBodyName(), action);
 				}
 
 				if(subFile != null){
 					Files.deleteIfExists(subFile);
 				}
 				if (policy.getConfigurationData()!= null){
-					writePolicySubFile(policy, "Config");
+					writePolicySubFile(policy, config);
 				}else if(policy.getActionBodyEntity()!= null){
-					writePolicySubFile(policy, "Action");
+					writePolicySubFile(policy, action);
 				}
 			}
 		} catch (IOException e1) {
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, "PolicyDBDao", "Error occurred while performing [" + action + "] of Policy File: " + policyName);
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, policyDBDaoVar, "Error occurred while performing [" + action + "] of Policy File: " + policyName);
 		}	
 	}
 
@@ -1107,9 +1071,10 @@
 		return fileName.substring(0, fileName.lastIndexOf('.'));
 	}
 
-	private Path getPolicySubFile(String filename, String subFileType){
+	private Path getPolicySubFile(String inputFileName, String subFileType){
+		String filename = inputFileName;
 		logger.info("getPolicySubFile(" + filename + ", " + subFileType + ")");
-		Path filePath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS).toString(), subFileType);
+		Path filePath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS), subFileType);
 		File file = null;
 
 		filename = FilenameUtils.removeExtension(filename);
@@ -1134,14 +1099,13 @@
 		String type = null;
 		String subTypeName = null;
 		String subTypeBody = null;
-		if (policyType.equalsIgnoreCase("config")){
-			type = "Config";
+		if (config.equalsIgnoreCase(policyType)){
+			type = config;
 			subTypeName = FilenameUtils.removeExtension(policy.getConfigurationData().getConfigurationName());
 			subTypeBody = policy.getConfigurationData().getConfigBody();
 
 			String configType = policy.getConfigurationData().getConfigType();
 
-
 			if (configType != null) {
 				if (configType.equals(JSON_CONFIG)) {
 					subTypeName = subTypeName + ".json";
@@ -1156,13 +1120,10 @@
 					subTypeName = subTypeName + ".txt";
 				}
 			}
-
-		}else if (policyType.equalsIgnoreCase("action")){
-			type = "Action";
+		}else if (action.equalsIgnoreCase(policyType)){
+			type = action;
 			subTypeName = policy.getActionBodyEntity().getActionBodyName();
 			subTypeBody = policy.getActionBodyEntity().getActionBody();
-
-
 		}
 		Path filePath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS).toString(), type);
 
@@ -1173,18 +1134,18 @@
 		try {
 			Files.deleteIfExists(Paths.get(filePath.toString(), subTypeName));
 			File file = Paths.get(filePath.toString(),subTypeName).toFile();
-			file.createNewFile();
-			FileWriter fileWriter = new FileWriter(file, false); // false to overwrite
-			fileWriter.write(subTypeBody);
-			fileWriter.close();
-			success = true;
-
+			boolean value = file.createNewFile();
+			logger.debug("New file created successfully"+value);
+			try(FileWriter fileWriter = new FileWriter(file, false)){
+				// false to overwrite
+				fileWriter.write(subTypeBody);
+				fileWriter.close();
+				success = true;
+			}
 		} catch (Exception e) {
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Exception occured while creating Configuration File for Policy : " + policy.getPolicyName());
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Exception occured while creating Configuration File for Policy : " + policy.getPolicyName());
 		}					
-
 		return success;
-
 	}
 
 	public void auditLocalDatabase(PAPPolicyEngine papEngine2){
@@ -1193,7 +1154,7 @@
 			deleteAllGroupTables();
 			auditGroups(papEngine2);
 		} catch(Exception e){
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "auditLocalDatabase() error");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "auditLocalDatabase() error");
 			logger.error("Exception Occured"+e);
 		}
 	}
@@ -1205,34 +1166,28 @@
 		EntityManager em = emf.createEntityManager();
 		em.getTransaction().begin();
 		
-		Query groupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-		groupQuery.setParameter("groupId", group.getId());
-		groupQuery.setParameter("deleted", false);
-		List<?> groupQueryList;
-		try{
-			groupQueryList = groupQuery.getResultList();
-		}catch(Exception e){
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if group exists groupQuery.getResultList()");
+		StdPDPGroup updatedGroup = null;
+		try {
+			Query groupQuery = em.createQuery(groupEntitySelectQuery);
+			groupQuery.setParameter(groupIdVar, group.getId());
+			groupQuery.setParameter(deletedVar, false);
+			List<?> groupQueryList = groupQuery.getResultList();
+			if(groupQueryList!=null && !groupQueryList.isEmpty()){
+				GroupEntity dbgroup = (GroupEntity)groupQueryList.get(0);
+				updatedGroup = synchronizeGroupPoliciesInFileSystem(group, dbgroup);
+				logger.info("Group was updated during file system audit: " + updatedGroup.toString());
+			}
+		} catch (PAPException | PolicyDBException e) {
+			logger.error(e);
+		} catch (Exception e) {
+			logger.error(e);
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if group exists groupQuery.getResultList()");
 			throw new PersistenceException("Query failed trying to check if group "+group.getId()+" exists");
 		}
 		
-		GroupEntity dbgroup = null;
-		if(groupQueryList!=null){
-			dbgroup = (GroupEntity)groupQueryList.get(0);
-		}
-		
 		em.getTransaction().commit();
 		em.close();
 		
-		StdPDPGroup updatedGroup = null;
-		try {
-			updatedGroup = synchronizeGroupPoliciesInFileSystem(group, dbgroup);
-		} catch (PAPException e) {
-			logger.error(e);
-		} catch (PolicyDBException e) {
-			logger.error(e);
-		}
-		logger.info("Group was updated during file system audit: " + updatedGroup.toString());
 		return updatedGroup;
 		
 	}
@@ -1295,7 +1250,7 @@
 							List<PolicyEntity> policyEntityList;
 							Query getPolicyEntitiesQuery = em.createNamedQuery("PolicyEntity.findByNameAndScope");
 							getPolicyEntitiesQuery.setParameter("name", stringArray[0]);
-							getPolicyEntitiesQuery.setParameter("scope", stringArray[1]);
+							getPolicyEntitiesQuery.setParameter(scope, stringArray[1]);
 
 							policyEntityList = getPolicyEntitiesQuery.getResultList();
 							PolicyEntity policyEntity = null;
@@ -1306,16 +1261,16 @@
 								groupEntity.addPolicyToGroup(policyEntity);
 							}
 						}catch(Exception e2){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "Exception auditGroups inner catch");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, policyDBDaoVar, "Exception auditGroups inner catch");
 						}
 					}
 				}catch(Exception e1){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, "PolicyDBDao", "Exception auditGroups middle catch");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, policyDBDaoVar, "Exception auditGroups middle catch");
 				}
 			}
 		}catch(Exception e){
 			em.getTransaction().rollback();
-			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Exception auditGroups outer catch");
+			PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Exception auditGroups outer catch");
 			em.close();
 			return;
 		}
@@ -1334,7 +1289,8 @@
 	//copied from ConfigPolicy.java and modified
 	// Here we are adding the extension for the configurations file based on the
 	// config type selection for saving.
-	private String getConfigFile(String filename, String configType) {
+	private String getConfigFile(String inputFilename, String configType) {
+		String filename = inputFilename;
 		logger.debug("getConfigFile(String filename, String scope, String configType) as getConfigFile("+filename+", "+configType+") called");
 		filename = FilenameUtils.removeExtension(filename);
 		String id = configType;
@@ -1412,7 +1368,7 @@
 			if(!(s instanceof String)){
 				return true;
 			}
-			if(s.equals("")){
+			if("".equals(s)){
 				return true;
 			}
 		}
@@ -1531,7 +1487,7 @@
 				try{
 					em.getTransaction().commit();
 				} catch(RollbackException e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught RollbackException on em.getTransaction().commit()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught RollbackException on em.getTransaction().commit()");
 					throw new PersistenceException("The commit failed. Message:\n"+e.getMessage());
 				}
 				em.close();
@@ -1541,13 +1497,13 @@
 						try{
 							notifyOthers(policyId,POLICY_NOTIFICATION,newGroupId);
 						} catch(Exception e){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on notifyOthers("+policyId+","+POLICY_NOTIFICATION+","+newGroupId+")");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on notifyOthers("+policyId+","+POLICY_NOTIFICATION+","+newGroupId+")");
 						}
 					} else {
 						try{
 							notifyOthers(policyId,POLICY_NOTIFICATION);
 						} catch(Exception e){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on notifyOthers("+policyId+","+POLICY_NOTIFICATION+")");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on notifyOthers("+policyId+","+POLICY_NOTIFICATION+")");
 						}
 					}
 				}
@@ -1557,13 +1513,13 @@
 						try{
 							notifyOthers(groupId,GROUP_NOTIFICATION,newGroupId);
 						} catch(Exception e){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on notifyOthers("+groupId+","+GROUP_NOTIFICATION+","+newGroupId+")");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on notifyOthers("+groupId+","+GROUP_NOTIFICATION+","+newGroupId+")");
 						}
 					} else {
 						try{
 							notifyOthers(groupId,GROUP_NOTIFICATION);
 						} catch(Exception e){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on notifyOthers("+groupId+","+GROUP_NOTIFICATION+")");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on notifyOthers("+groupId+","+GROUP_NOTIFICATION+")");
 						}
 					}
 				}
@@ -1572,7 +1528,7 @@
 					try{
 						notifyOthers(pdpId,PDP_NOTIFICATION);
 					} catch(Exception e){
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on notifyOthers("+pdpId+","+PDP_NOTIFICATION+")");
+						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on notifyOthers("+pdpId+","+PDP_NOTIFICATION+")");
 					}
 				}
 			}
@@ -1590,12 +1546,12 @@
 					try{
 						em.getTransaction().rollback();					
 					} catch(Exception e){
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Could not rollback transaction");
+						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Could not rollback transaction");
 					}
 					try{
 						em.close();
 					}catch(Exception e){
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Could not close EntityManager");
+						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Could not close EntityManager");
 					}
 
 				} else {
@@ -1610,11 +1566,10 @@
 			if(transactionTimer instanceof Thread){
 				transactionTimer.interrupt();
 			}
-
-
 		}
 
-		private void createPolicy(PolicyRestAdapter policy, String username, String policyScope, String policyName, String policyDataString) {
+		private void createPolicy(PolicyRestAdapter policy, String username, String policyScope, String inputPolicyName, String policyDataString) {
+			String policyName = inputPolicyName;
 			logger.debug("createPolicy(PolicyRestAdapter policy, String username, String policyScope, String policyName, String policyDataString) as createPolicy("+policy+", "+username+", "+policyScope+", "+policyName+", "+policyDataString+") called");
 			synchronized(emLock){
 				checkBeforeOperationRun();
@@ -1628,12 +1583,12 @@
 				}
 				policyName = policyName.split(":")[1];
 				Query createPolicyQuery = em.createQuery("SELECT p FROM PolicyEntity p WHERE p.scope=:scope AND p.policyName=:policyName");			
-				createPolicyQuery.setParameter("scope", policyScope);
+				createPolicyQuery.setParameter(scope, policyScope);
 				createPolicyQuery.setParameter("policyName", policyName);
 				List<?> createPolicyQueryList = createPolicyQuery.getResultList();
 				PolicyEntity newPolicyEntity;
 				boolean update;
-				if(createPolicyQueryList.size() < 1){
+				if(createPolicyQueryList.isEmpty()){
 					newPolicyEntity = new PolicyEntity();
 					update = false;
 				} else if(createPolicyQueryList.size() > 1){
@@ -1645,7 +1600,7 @@
 				}			
 
 				ActionBodyEntity newActionBodyEntity = null;
-				if(policy.getPolicyType().equals("Action")){
+				if(policy.getPolicyType().equals(action)){
 					boolean abupdate = false;
 					if(newPolicyEntity.getActionBodyEntity() == null){
 						newActionBodyEntity = new ActionBodyEntity();
@@ -1662,45 +1617,12 @@
 						//trim the .xml off the end
 						String policyNameClean = FilenameUtils.removeExtension(configName);
 						String actionBodyName =  policyNameClean + ".json";
-						Path actionBodyPath = Paths.get(Webapps.getActionHome(), actionBodyName);
-						if(logger.isDebugEnabled()){
-							logger.debug("\nPolicyDBDao.createPolicy"
-									+ "\n   actionBodyPath = " + actionBodyPath);
-						}
+
 						//get the action body
-						String actionBodyString = null;
-						String actionBodyPathStr = null;
-						InputStream fileContentStream = null;
-
-						if (Files.exists(actionBodyPath)) {
-							try {
-								actionBodyPathStr = (actionBodyPath != null ? actionBodyPath.toString() : null);
-								fileContentStream = new FileInputStream(actionBodyPathStr);
-								actionBodyString = IOUtils.toString(fileContentStream);
-								if(logger.isDebugEnabled()){
-									logger.debug("\nPolicyDBDao.createPolicy"
-											+ "\n   actionBodyPathStr = " + actionBodyPathStr
-											+ "\n   actionBodyString = " + actionBodyString);
-								}
-							} catch (FileNotFoundException e) {
-								PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught FileNotFoundException on new actionBodyPathStr FileInputStream("+actionBodyPathStr+")");
-								throw new IllegalArgumentException("The actionBodyPathStr file path " + actionBodyPathStr + " does not exist" 
-										+ "\nEXCEPTION: " + e);
-							} catch(IOException e2){
-								PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "Caught IOException on actionBodyPath newIOUtils.toString("+fileContentStream+")");
-								throw new IllegalArgumentException("The actionBodyPath file path cannot be read" + fileContentStream 
-										+ "\nEXCEPTION: " + e2);
-							} finally {
-								IOUtils.closeQuietly(fileContentStream);
-							}
-
-							if(actionBodyString == null){
-								throw new IllegalArgumentException("The file path (" + actionBodyPathStr + ") cannot be read");
-							}
-						} else {
+						String actionBodyString = policy.getActionBody();
+						if(actionBodyString == null){
 							actionBodyString = "{}";
 						}
-
 						newActionBodyEntity.setActionBody(actionBodyString);
 						newActionBodyEntity.setActionBodyName(actionBodyName);
 						newActionBodyEntity.setModifiedBy("PolicyDBDao.createPolicy()");
@@ -1732,7 +1654,7 @@
 				}
 
 				ConfigurationDataEntity newConfigurationDataEntity;
-				if(policy.getPolicyType().equals("Config")){
+				if(policy.getPolicyType().equals(config)){
 					boolean configUpdate;
 					if(newPolicyEntity.getConfigurationData() == null){
 						newConfigurationDataEntity = new ConfigurationDataEntity();
@@ -1770,7 +1692,7 @@
 								newConfigurationDataEntity.setConfigBody(policy.getConfigBodyData());
 							}
 						}
-						if(newConfigurationDataEntity.isDeleted() == true){
+						if(newConfigurationDataEntity.isDeleted()){
 							newConfigurationDataEntity.setDeleted(false);
 						}
 
@@ -1818,11 +1740,9 @@
 				newPolicyEntity.setConfigurationData(newConfigurationDataEntity);
 				newPolicyEntity.setActionBodyEntity(newActionBodyEntity);
 
-
 				em.flush();
 				this.policyId = newPolicyEntity.getPolicyId();
 			}
-
 			return;
 		}
 
@@ -1848,7 +1768,7 @@
 					policyId = policyName;
 					policyQuery = em.createQuery("SELECT p FROM PolicyEntity p WHERE p.policyName=:name AND p.scope=:scope");
 					policyQuery.setParameter("name", policyId);
-					policyQuery.setParameter("scope", scope);
+					policyQuery.setParameter(scope, scope);
 				} else{
 					policyId = String.valueOf(policyID);
 					policyQuery = em.createNamedQuery("PolicyEntity.FindById");
@@ -1858,136 +1778,21 @@
 				try{
 					policyQueryList = policyQuery.getResultList();
 				}catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get policy with policyQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get policy with policyQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get policy "+policyId);
 				}
-				if(policyQueryList.size() < 1){
+				if(policyQueryList.isEmpty()){
 					PolicyLogger.error("Policy does not exist with id "+policyId);
 					throw new PersistenceException("Group policy is being added to does not exist with id "+policyId);
 				} else if(policyQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one policy with the id "+policyId+" were found in the database");
-					throw new PersistenceException("Somehow, more than one policy with the id "+policyId+" were found in the database");
+					PolicyLogger.error(duplicatePolicyId+policyId+foundInDB);
+					throw new PersistenceException(duplicatePolicyId+policyId+foundInDB);
 				}
 				return (PolicyEntity)policyQueryList.get(0);
 			}
 		}
 
 		@Override
-		public void renamePolicy(String oldPath, String newPath,String username){
-/*			String[] oldPolicy = getScopeAndNameAndType(oldPath);
-			String[] newPolicy = getScopeAndNameAndType(newPath);
-			if(oldPolicy == null || newPolicy == null){
-				PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW+"Could not parse one or more of the path names: "
-						+oldPath+", "+newPath);
-				throw new IllegalArgumentException("Could not parse one or more of the path names");
-			}
-			synchronized (emLock) {
-				checkBeforeOperationRun();
-
-				PolicyEntity existingPolicy;
-				boolean existingPolicyDeleted = false;
-				List<?> groups = null;
-				try{
-					existingPolicy = getPolicy(newPolicy[1],newPolicy[0]);
-				} catch(Exception e){
-					existingPolicy = null;
-				}
-				if(existingPolicy != null && !existingPolicy.isDeleted()){
-					logger.error("The policy named "+existingPolicy.getPolicyName()+" already exists, cannot rename policy: "+newPolicy);
-					throw new IllegalArgumentException("The policy named "+existingPolicy.getPolicyName()+" already exists, cannot rename policy: "+newPolicy);
-				} else if(existingPolicy != null && existingPolicy.isDeleted()){
-					try{
-						Query getGroups = em.createQuery("SELECT g FROM GroupEntity g JOIN g.policies p WHERE p.policyId=:pid");
-
-						getGroups.setParameter("pid", existingPolicy.getPolicyId());
-						groups = getGroups.getResultList();
-					}catch(Exception e){
-						groups = new LinkedList<>();
-					}
-					for(Object o : groups){
-						GroupEntity group = (GroupEntity)o;
-						group.removePolicyFromGroup(existingPolicy);
-					}
-					try{
-						em.flush();
-					}catch(Exception e){
-						logger.error("Error while removing the policy from groups: "+existingPolicy.getPolicyName());
-					}
-					try{
-						em.remove(existingPolicy);
-						em.flush();
-					}catch(Exception e){
-						logger.error("Could not remove the existing deleted policy: "+existingPolicy.getPolicyName());
-					}
-					existingPolicyDeleted = true;
-					//create the new policy
-					//for each of the groups, add the new policy
-				}
-
-				PolicyEntity policyToRename;
-				try{
-					policyToRename = getPolicy(oldPolicy[1],oldPolicy[0]);
-				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "PolicyDBDao", "Could not get policy record to rename: "
-							+oldPolicy[1]);
-					throw new PersistenceException("Could not get policy record to rename");
-				}
-				String policyDataString = null;
-				InputStream fileContentStream = null;
-				String policyFilePath = Paths.get(oldPath).toAbsolutePath().toString();
-				//I want to try the old path first, then if it doesn't work, try the new path
-				for(int i=0;i<2;i++){
-					try {
-						fileContentStream = new FileInputStream(policyFilePath);
-						policyDataString = IOUtils.toString(fileContentStream);
-					} catch (FileNotFoundException e) {
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught FileNotFoundException on new FileInputStream("+policyFilePath+")");
-						//if we can't find the oldPath, we'll try the new path
-						if(i == 0){
-							policyFilePath = Paths.get(newPath).toAbsolutePath().toString();
-							continue;
-						}
-						throw new IllegalArgumentException("The file path does not exist");
-					} catch(IOException e2){
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "Caught IOException on newIOUtils.toString("+fileContentStream+")");
-						throw new IllegalArgumentException("The file path cannot be read");
-					} finally {
-						IOUtils.closeQuietly(fileContentStream);
-					}
-					if(policyDataString == null){
-						throw new IllegalArgumentException("The file path cannot be read");
-					}
-					//escape the loop
-					i=2;
-				}
-				policyToRename.setPolicyName(newPolicy[1]);
-				policyToRename.setPolicyData(policyDataString);
-				policyToRename.setScope(newPolicy[0]);
-				policyToRename.setModifiedBy(username);
-				if(policyToRename.getConfigurationData() != null){
-					String configType = policyToRename.getConfigurationData().getConfigType();
-					policyToRename.getConfigurationData().setConfigurationName(getConfigFile(newPolicy[1], configType));
-					policyToRename.getConfigurationData().setModifiedBy(username);
-				}
-				if(policyToRename.getActionBodyEntity() != null){
-					String newActionName = newPolicy[0]+"."+removeFileExtension(newPolicy[1])+".json";
-					policyToRename.getActionBodyEntity().setActionBodyName(newActionName);
-					policyToRename.getActionBodyEntity().setModifiedBy(username);
-				}
-				if(existingPolicyDeleted){
-					for(Object o : groups){
-
-						GroupEntity group = (GroupEntity)o;
-						group.addPolicyToGroup(policyToRename);
-					}
-				}
-				em.flush();
-				this.policyId = policyToRename.getPolicyId();
-				this.newGroupId = oldPath;
-			}*/
-		}
-
-		@Override
 		public GroupEntity getGroup(long groupKey){
 			logger.debug("getGroup(int groupKey) as getGroup("+groupKey+") called");
 			if(groupKey < 0){
@@ -2002,15 +1807,15 @@
 				try{
 					groupQueryList = groupQuery.getResultList();
 				}catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get group with groupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to get group "+groupKey);
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get group with groupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToGetGroup+groupKey);
 				}
-				if(groupQueryList.size() < 1){
+				if(groupQueryList.isEmpty()){
 					PolicyLogger.error("Group does not exist with groupKey "+groupKey);
 					throw new PersistenceException("Group does not exist with groupKey "+groupKey);
 				} else if(groupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the groupKey "+groupKey+" were found in the database");
-					throw new PersistenceException("Somehow, more than one group with the groupKey "+groupKey+" were found in the database");
+					PolicyLogger.error("Somehow, more than one group with the groupKey "+groupKey+foundInDB);
+					throw new PersistenceException("Somehow, more than one group with the groupKey "+groupKey+foundInDB);
 				}
 				return (GroupEntity)groupQueryList.get(0);
 			}
@@ -2026,24 +1831,25 @@
 				checkBeforeOperationRun(true);
 				//check if group exists
 				Query groupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId");
-				groupQuery.setParameter("groupId", groupId);			
+				groupQuery.setParameter(groupIdVar, groupId);			
 				List<?> groupQueryList;
 				try{
 					groupQueryList = groupQuery.getResultList();
 				}catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get group with groupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to get group "+groupId);
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get group with groupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToGetGroup+groupId);
 				}
-				if(groupQueryList.size() < 1){
+				if(groupQueryList.isEmpty()){
 					PolicyLogger.error("Group does not exist with id "+groupId);
 					throw new PersistenceException("Group does not exist with id "+groupId);
 				} else if(groupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the id "+groupId+" were found in the database");
-					throw new PersistenceException("Somehow, more than one group with the id "+groupId+" were found in the database");
+					PolicyLogger.error(duplicateGroupId +groupId+foundInDB);
+					throw new PersistenceException(duplicateGroupId+groupId+foundInDB);
 				}
 				return (GroupEntity)groupQueryList.get(0);
 			}
 		}
+		
 		@Override
 		public List<?> getPdpsInGroup(long groupKey){
 			logger.debug("getPdpsInGroup(int groupKey) as getPdpsInGroup("+groupKey+") called");
@@ -2057,6 +1863,7 @@
 				return pdpsQuery.getResultList();
 			}
 		}
+		
 		@Override
 		public PdpEntity getPdp(long pdpKey){
 			logger.debug("getPdp(int pdpKey) as getPdp("+pdpKey+") called");
@@ -2072,65 +1879,19 @@
 				try{
 					pdpQueryList = pdpQuery.getResultList();
 				}catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get pdp with pdpQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get pdp with pdpQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get pdp "+pdpKey);
 				}
-				if(pdpQueryList.size() < 1){
+				if(pdpQueryList.isEmpty()){
 					PolicyLogger.error("Pdp does not exist with pdpKey "+pdpKey);
 					throw new PersistenceException("Pdp does not exist with pdpKey "+pdpKey);
 				} else if(pdpQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one pdp with the pdpKey "+pdpKey+" were found in the database");
-					throw new PersistenceException("Somehow, more than one pdp with the pdpKey "+pdpKey+" were found in the database");
+					PolicyLogger.error("Somehow, more than one pdp with the pdpKey "+pdpKey+foundInDB);
+					throw new PersistenceException("Somehow, more than one pdp with the pdpKey "+pdpKey+foundInDB);
 				}
 				return (PdpEntity)pdpQueryList.get(0);
 			}
 		}
-		
-		public void deletePolicy(String policyToDeletes){
-			/*synchronized(emLock){
-				checkBeforeOperationRun();
-				logger.debug("deletePolicy(String policyToDeletes) as deletePolicy("+policyToDeletes+") called");
-				String[] scopeNameAndType = getScopeAndNameAndType(policyToDeletes);
-				if(scopeNameAndType == null){
-					throw new IllegalArgumentException("Could not parse file path");
-				}
-				String realScope = scopeNameAndType[0];
-				String realName = scopeNameAndType[1];
-				Query deletePolicyQuery = em.createQuery("SELECT p FROM PolicyEntity p WHERE p.scope=:scope AND p.policyName=:policyName AND p.deleted=:deleted");			
-				deletePolicyQuery.setParameter("scope",realScope);
-				deletePolicyQuery.setParameter("policyName", realName);
-				deletePolicyQuery.setParameter("deleted", false);
-				List<?> deletePolicyQueryList = deletePolicyQuery.getResultList();
-				if(deletePolicyQueryList.size() < 1){
-					logger.warn("The policy being deleted could not be found.");
-					return;
-				} else if(deletePolicyQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one policy with the same scope, name, and deleted status were found in the database");
-					throw new PersistenceException("Somehow, more than one policy with the same scope, name, and deleted status were found in the database");
-				} else {
-					PolicyEntity policyToDelete = (PolicyEntity)deletePolicyQueryList.get(0);
-					policyToDelete.setDeleted(true);
-					if(policyToDelete.getConfigurationData() != null){
-						ConfigurationDataEntity cde = em.find(ConfigurationDataEntity.class,policyToDelete.getConfigurationData().getConfigurationDataId());					
-						if(cde != null){
-							cde.setDeleted(true);
-						}
-					}
-					if(policyToDelete.getActionBodyEntity() != null){
-						ActionBodyEntity abe = em.find(ActionBodyEntity.class,policyToDelete.getActionBodyEntity().getActionBodyId());					
-						if(abe != null){
-							abe.setDeleted(true);
-						}
-					}
-
-					em.flush();
-					this.policyId = policyToDelete.getPolicyId();
-
-				}
-			}
-*/
-		}
-
 
 		@Override
 		public boolean isTransactionOpen() {
@@ -2140,51 +1901,8 @@
 			}
 		}
 
-
-		@Override
-		public void clonePolicy(String oldPolicyPath, String newPolicyPath, String username){
-			/*String[] oldPolicyData = getScopeAndNameAndType(oldPolicyPath);
-			String[] newPolicyData = getScopeAndNameAndType(newPolicyPath);
-			if(oldPolicyData == null || newPolicyData == null){
-				PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW+"Could not parse one or more of the path names: "
-						+oldPolicyPath+", "+newPolicyPath);
-				throw new IllegalArgumentException("Could not parse the oldPolicyPath or newPolicyPath");
-			}
-			PolicyEntity oldPolicy;
-			try{
-				oldPolicy = getPolicy(oldPolicyData[1],oldPolicyData[0]);
-			}catch(Exception e){
-				PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "PolicyDBDao", "Could not get policy record to clone: "
-						+oldPolicyData[1]);
-				throw new PersistenceException("Could not get policy record to clone");
-			}
-			ConfigurationDataEntity clonedConfig = null;
-			if(oldPolicy.getConfigurationData() != null){
-				clonedConfig = new ConfigurationDataEntity();
-				em.persist(clonedConfig);
-				clonedConfig.setConfigBody(oldPolicy.getConfigurationData().getConfigBody());
-				clonedConfig.setConfigType(oldPolicy.getConfigurationData().getConfigType());
-				clonedConfig.setCreatedBy(username);
-				clonedConfig.setConfigurationName(getConfigFile(newPolicyData[1], oldPolicy.getConfigurationData().getConfigType()));
-				clonedConfig.setDescription(oldPolicy.getConfigurationData().getDescription());
-				clonedConfig.setModifiedBy(username);
-				em.flush();
-			}
-			ActionBodyEntity clonedAction = null;
-			if(oldPolicy.getActionBodyEntity() != null){
-				clonedAction = new ActionBodyEntity();
-				em.persist(clonedAction);
-				clonedAction.setActionBody(oldPolicy.getActionBodyEntity().getActionBody());
-				clonedAction.setActionBodyName(newPolicyData[0]+"."+newPolicyData[1]+".json");
-				clonedAction.setCreatedBy(username);
-				clonedAction.setModifiedBy(username);
-				em.flush();
-			}			
-
-*/
-		}
-
-		private String processConfigPath(String configPath){
+		private String processConfigPath(String inputConfigPath){
+			String configPath = inputConfigPath;
 			String webappsPath = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS);
 			if(webappsPath == null){
 				logger.error("Webapps property does not exist");
@@ -2200,6 +1918,7 @@
 			}
 			return configPath;
 		}
+		
 		private String readConfigFile(String configPath){
 			String configDataString = null;
 			InputStream configContentStream = null;
@@ -2235,19 +1954,23 @@
 					policyDataString = IOUtils.toString(policyXmlStream);
 				} catch (IOException e) {
 					policyDataString = "could not read";
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught IOException on IOUtils.toString("+policyXmlStream+")");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught IOException on IOUtils.toString("+policyXmlStream+")");
 					throw new IllegalArgumentException("Cannot parse the policy xml from the PolicyRestAdapter.");
 				}
 				IOUtils.closeQuietly(policyXmlStream);
+				if(isJunit){
+					//Using parentPath object to set policy data.
+					policyDataString = policy.policyAdapter.getParentPath();
+				}
 				String configPath = "";
-				if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Config")) {
+				if (policy.policyAdapter.getPolicyType().equalsIgnoreCase(config)) {
 					configPath = evaluateXPath("/Policy/Rule/AdviceExpressions/AdviceExpression[contains(@AdviceId,'ID')]/AttributeAssignmentExpression[@AttributeId='URLID']/AttributeValue/text()", policyDataString);
-				} else if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Action")) {
+				} else if (policy.policyAdapter.getPolicyType().equalsIgnoreCase(action)) {
 					configPath = evaluateXPath("/Policy/Rule/ObligationExpressions/ObligationExpression[contains(@ObligationId, " +policy.policyAdapter.getActionAttribute()+ ")]/AttributeAssignmentExpression[@AttributeId='body']/AttributeValue/text()", policyDataString);
 				}
 
 				String prefix = null;
-				if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Config")) {
+				if (policy.policyAdapter.getPolicyType().equalsIgnoreCase(config)) {
 
 					prefix = configPath.substring(configPath.indexOf(policyScope+".")+policyScope.concat(".").length(), configPath.lastIndexOf(policy.policyAdapter.getPolicyName()));
 					if(isNullOrEmpty(policy.policyAdapter.getConfigBodyData())){
@@ -2265,9 +1988,9 @@
 						}
 						policy.policyAdapter.setConfigBodyData(configData);
 					}
-				} else if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Action")) {
+				} else if (action.equalsIgnoreCase(policy.policyAdapter.getPolicyType())) {
 					prefix = "Action_";
-				} else if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Decision")) {
+				} else if ("Decision".equalsIgnoreCase(policy.policyAdapter.getPolicyType())) {
 					prefix = "Decision_";
 				}
 
@@ -2276,13 +1999,11 @@
 					throw new IllegalArgumentException("The data field is not an instance of PolicyType");
 				}
 				String finalName = policyScope + "." + prefix+policy.policyAdapter.getPolicyName()+"."+((PolicyType)policy.policyAdapter.getData()).getVersion()+".xml";
-				if(policy.policyAdapter.getConfigType() == null || policy.policyAdapter.getConfigType().equals("")){
+				if(policy.policyAdapter.getConfigType() == null || "".equals(policy.policyAdapter.getConfigType())){
 					//get the config file extension
 					String ext = "";
-					if (configPath != null) {
-						if (!configPath.equalsIgnoreCase("")) {
-							ext = configPath.substring(configPath.lastIndexOf('.'), configPath.length());;
-						}
+					if (configPath != null && !"".equalsIgnoreCase(configPath)) {
+						ext = configPath.substring(configPath.lastIndexOf('.'), configPath.length());;
 					}
 
 					if(ext.contains("txt")){
@@ -2294,7 +2015,7 @@
 					} else if(ext.contains("properties")){
 						policy.policyAdapter.setConfigType(PROPERTIES_CONFIG);
 					} else {
-						if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Action")){
+						if (policy.policyAdapter.getPolicyType().equalsIgnoreCase(action)){
 							policy.policyAdapter.setConfigType(JSON_CONFIG);
 						}
 					}
@@ -2327,31 +2048,30 @@
 			}
 		}
 
-
-
 		@Override
-		public void createGroup(String groupId, String groupName, String groupDescription, String username) {
+		public void createGroup(String groupId, String groupName, String inputGroupDescription, String username) {
+			String groupDescription = inputGroupDescription;
 			logger.debug("deletePolicy(String policyToDeletes) as createGroup("+groupId+", "+groupName+", "+groupDescription+") called");
 			if(isNullOrEmpty(groupId, groupName, username)){
 				throw new IllegalArgumentException("groupId, groupName, and username must not be null or empty");
 			}
-			if(!(groupDescription instanceof String)){
+			if(groupDescription == null){
 				groupDescription = "";
 			}
 
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query checkGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				checkGroupQuery.setParameter("groupId", groupId);
-				checkGroupQuery.setParameter("deleted", false);
+				Query checkGroupQuery = em.createQuery(groupEntitySelectQuery);
+				checkGroupQuery.setParameter(groupIdVar, groupId);
+				checkGroupQuery.setParameter(deletedVar, false);
 				List<?> checkGroupQueryList;
 				try{
 					checkGroupQueryList = checkGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on checkGroupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to check for existing group");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on checkGroupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToCheckExisting);
 				}
-				if(checkGroupQueryList.size() > 0){
+				if(!checkGroupQueryList.isEmpty()){
 					PolicyLogger.error("The group being added already exists with id "+groupId);
 					throw new PersistenceException("The group being added already exists with id "+groupId);
 				}
@@ -2380,22 +2100,22 @@
 
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query getGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				getGroupQuery.setParameter("groupId", group.getId());
-				getGroupQuery.setParameter("deleted", false);
+				Query getGroupQuery = em.createQuery(groupEntitySelectQuery);
+				getGroupQuery.setParameter(groupIdVar, group.getId());
+				getGroupQuery.setParameter(deletedVar, false);
 				List<?> getGroupQueryList;
 				try{
 					getGroupQueryList = getGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on getGroupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to get group "+group.getId()+" for editing");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on getGroupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToGetGroup+group.getId()+" for editing");
 				}
-				if(getGroupQueryList.size() < 1){
+				if(getGroupQueryList.isEmpty()){
 					PolicyLogger.error("The group cannot be found to update with id "+group.getId());
 					throw new PersistenceException("The group cannot be found to update with id "+group.getId());
 				} else if(getGroupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the same id "+group.getId()+" and deleted status were found in the database");
-					throw new PersistenceException("Somehow, more than one group with the same id "+group.getId()+" and deleted status were found in the database");
+					PolicyLogger.error(duplicateGroupId+group.getId()+deletedStatusFound);
+					throw new PersistenceException(duplicateGroupId+group.getId()+deletedStatusFound);
 				}
 				GroupEntity groupToUpdateInDB = (GroupEntity)getGroupQueryList.get(0);
 				if(!stringEquals(groupToUpdateInDB.getModifiedBy(), username)){
@@ -2409,7 +2129,7 @@
 				try {
 					oldGroup = (StdPDPGroup) papEngine.getGroup(group.getId());
 				} catch (PAPException e1) {
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, "PolicyDBDao", "We cannot get the group from the papEngine to delete policies");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e1, policyDBDaoVar, "We cannot get the group from the papEngine to delete policies");
 				}
 				if(oldGroup == null){
 					PolicyLogger.error("We cannot get the group from the papEngine to delete policies");
@@ -2427,12 +2147,10 @@
 							try{
 								if(scopeAndName!=null){
 									policyToDelete = getPolicy(scopeAndName[0],scopeAndName[1]);
-								
 									if ("XACMLPapServlet.doDelete".equals(username)) {
-	
 										Iterator<PolicyEntity> dbPolicyIt = groupToUpdateInDB.getPolicies().iterator();
 										String policyName = getPolicyNameAndVersionFromPolicyFileName(policyToDelete.getPolicyName())[0];
-						            	
+						        
 										logger.info("PolicyDBDao: delete policy from GroupEntity");
 										try{
 											while(dbPolicyIt.hasNext()){
@@ -2451,10 +2169,9 @@
 											PolicyLogger.error("Could not delete policy with name: "+ policyToDelete.getScope()+"."+policyToDelete.getPolicyName()+"\n ID: "+ policyToDelete.getPolicyId());
 						            	}
 									}
-								}
-								
+								}	
 							}catch(Exception e){
-								PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Could not get policy to remove: "+pol.getId());
+								PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Could not get policy to remove: "+pol.getId());
 								throw new PersistenceException("Could not get policy to remove: "+pol.getId());
 							}
 						}
@@ -2464,17 +2181,17 @@
 				if(group.getName() != null && !stringEquals(group.getName(),groupToUpdateInDB.getgroupName())){
 					//we need to check if the new id exists in the database
 					String newGroupId = createNewPDPGroupId(group.getName());
-					Query checkGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-					checkGroupQuery.setParameter("groupId", newGroupId);
-					checkGroupQuery.setParameter("deleted", false);
+					Query checkGroupQuery = em.createQuery(groupEntitySelectQuery);
+					checkGroupQuery.setParameter(groupIdVar, newGroupId);
+					checkGroupQuery.setParameter(deletedVar, false);
 					List<?> checkGroupQueryList;
 					try{
 						checkGroupQueryList = checkGroupQuery.getResultList();
 					} catch(Exception e){
-						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on checkGroupQuery.getResultList()");
-						throw new PersistenceException("Query failed trying to check for existing group");
+						PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on checkGroupQuery.getResultList()");
+						throw new PersistenceException(queryFailedToCheckExisting);
 					}
-					if(checkGroupQueryList.size() != 0){
+					if(!checkGroupQueryList.isEmpty()){
 						PolicyLogger.error("The new group name already exists, group id "+newGroupId);
 						throw new PersistenceException("The new group name already exists, group id "+newGroupId);
 					}
@@ -2482,7 +2199,6 @@
 					groupToUpdateInDB.setGroupName(group.getName());
 					this.newGroupId = group.getId();
 				}
-
 				em.flush();
 				this.groupId = groupToUpdateInDB.getGroupKey();
 			}
@@ -2494,37 +2210,34 @@
 			if(isNullOrEmpty(pdpID, groupID,pdpName,username)){
 				throw new IllegalArgumentException("pdpID, groupID, pdpName, and username must not be null or empty");
 			}
-			if(!(pdpDescription instanceof String)){
-				pdpDescription = "";
-			}
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query checkGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				checkGroupQuery.setParameter("groupId", groupID);
-				checkGroupQuery.setParameter("deleted", false);
+				Query checkGroupQuery = em.createQuery(groupEntitySelectQuery);
+				checkGroupQuery.setParameter(groupIdVar, groupID);
+				checkGroupQuery.setParameter(deletedVar, false);
 				List<?> checkGroupQueryList;
 				try{
 					checkGroupQueryList = checkGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check for existing group on checkGroupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to check for existing group");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check for existing group on checkGroupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToCheckExisting);
 				}
 				if(checkGroupQueryList.size() != 1){
 					PolicyLogger.error("The group does not exist");
 					throw new PersistenceException("The group does not exist");
 				}
-				Query checkDuplicateQuery = em.createQuery("SELECT p FROM PdpEntity p WHERE p.pdpId=:pdpId AND p.deleted=:deleted");
-				checkDuplicateQuery.setParameter("pdpId", pdpID);
-				checkDuplicateQuery.setParameter("deleted", false);
+				Query checkDuplicateQuery = em.createQuery(pdpEntitySelectQuery);
+				checkDuplicateQuery.setParameter(pdpIdVariable, pdpID);
+				checkDuplicateQuery.setParameter(deletedVar, false);
 				List<?> checkDuplicateList;
 				try{
 					checkDuplicateList = checkDuplicateQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check for duplicate PDP "+pdpID+" on checkDuplicateQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check for duplicate PDP "+pdpID+" on checkDuplicateQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to check for duplicate PDP "+pdpID);
 				}
 				PdpEntity newPdp;
-				if(checkDuplicateList.size() > 0){
+				if(!checkDuplicateList.isEmpty()){
 					logger.warn("PDP already exists with id "+pdpID);				
 					newPdp = (PdpEntity)checkDuplicateList.get(0);
 				} else {
@@ -2543,7 +2256,6 @@
 
 				em.flush();
 				this.pdpId = newPdp.getPdpKey();
-
 			}
 		}
 
@@ -2560,22 +2272,22 @@
 
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query getPdpQuery = em.createQuery("SELECT p FROM PdpEntity p WHERE p.pdpId=:pdpId AND p.deleted=:deleted");
-				getPdpQuery.setParameter("pdpId", pdp.getId());
-				getPdpQuery.setParameter("deleted", false);
+				Query getPdpQuery = em.createQuery(pdpEntitySelectQuery);
+				getPdpQuery.setParameter(pdpIdVariable, pdp.getId());
+				getPdpQuery.setParameter(deletedVar, false);
 				List<?> getPdpQueryList;
 				try{
 					getPdpQueryList = getPdpQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on getPdpQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on getPdpQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get PDP "+pdp.getId());
 				}
-				if(getPdpQueryList.size() < 1){
+				if(getPdpQueryList.isEmpty()){
 					PolicyLogger.error("The pdp cannot be found to update with id "+pdp.getId());
 					throw new PersistenceException("The pdp cannot be found to update with id "+pdp.getId());
 				} else if(getPdpQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one pdp with the same id "+pdp.getId()+" and deleted status were found in the database");
-					throw new PersistenceException("Somehow, more than one pdp with the same id "+pdp.getId()+" and deleted status were found in the database");
+					PolicyLogger.error(moreThanOnePDP+pdp.getId()+deletedStatusFound);
+					throw new PersistenceException(moreThanOnePDP+pdp.getId()+deletedStatusFound);
 				}
 				PdpEntity pdpToUpdate = (PdpEntity)getPdpQueryList.get(0);
 				if(!stringEquals(pdpToUpdate.getModifiedBy(), username)){
@@ -2609,33 +2321,33 @@
 			synchronized(emLock){
 				checkBeforeOperationRun();
 				//check if pdp exists
-				Query getPdpQuery = em.createQuery("SELECT p FROM PdpEntity p WHERE p.pdpId=:pdpId AND p.deleted=:deleted");
-				getPdpQuery.setParameter("pdpId", pdp.getId());
-				getPdpQuery.setParameter("deleted", false);
+				Query getPdpQuery = em.createQuery(pdpEntitySelectQuery);
+				getPdpQuery.setParameter(pdpIdVariable, pdp.getId());
+				getPdpQuery.setParameter(deletedVar, false);
 				List<?> getPdpQueryList;
 				try{
 					getPdpQueryList = getPdpQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on getPdpQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on getPdpQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get pdp to move with id "+pdp.getId());
 				}
-				if(getPdpQueryList.size() < 1){
+				if(getPdpQueryList.isEmpty()){
 					PolicyLogger.error("The pdp cannot be found to move with id "+pdp.getId());
 					throw new PersistenceException("The pdp cannot be found to move with id "+pdp.getId());
 				} else if(getPdpQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one pdp with the same id "+pdp.getId()+" and deleted status were found in the database");
-					throw new PersistenceException("Somehow, more than one pdp with the same id "+pdp.getId()+" and deleted status were found in the database");
+					PolicyLogger.error(moreThanOnePDP+pdp.getId()+deletedStatusFound);
+					throw new PersistenceException(moreThanOnePDP+pdp.getId()+deletedStatusFound);
 				}
 
 				//check if new group exists
-				Query checkGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				checkGroupQuery.setParameter("groupId", group.getId());
-				checkGroupQuery.setParameter("deleted", false);
+				Query checkGroupQuery = em.createQuery(groupEntitySelectQuery);
+				checkGroupQuery.setParameter(groupIdVar, group.getId());
+				checkGroupQuery.setParameter(deletedVar, false);
 				List<?> checkGroupQueryList;
 				try{
 					checkGroupQueryList = checkGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get group on checkGroupQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get group on checkGroupQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get new group "+group.getId());
 				}
 				if(checkGroupQueryList.size() != 1){
@@ -2666,22 +2378,22 @@
 
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query getGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				getGroupQuery.setParameter("groupId", group.getId());
-				getGroupQuery.setParameter("deleted", false);
+				Query getGroupQuery = em.createQuery(groupEntitySelectQuery);
+				getGroupQuery.setParameter(groupIdVar, group.getId());
+				getGroupQuery.setParameter(deletedVar, false);
 				List<?> getGroupQueryList;
 				try{
 					getGroupQueryList = getGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on getGroupQuery.getResultList()");
-					throw new PersistenceException("Query failed trying to get group "+group.getId());
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on getGroupQuery.getResultList()");
+					throw new PersistenceException(queryFailedToGetGroup+group.getId());
 				}
-				if(getGroupQueryList.size() < 1){
+				if(getGroupQueryList.isEmpty()){
 					PolicyLogger.error("The group cannot be found to set default with id "+group.getId());				
 					throw new PersistenceException("The group cannot be found to set default with id "+group.getId());
 				} else if(getGroupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the same id "+group.getId()+" and deleted status were found in the database");
-					throw new PersistenceException("Somehow, more than one group with the same id "+group.getId()+" and deleted status were found in the database");
+					PolicyLogger.error(duplicateGroupId+group.getId()+deletedStatusFound);
+					throw new PersistenceException(duplicateGroupId+group.getId()+deletedStatusFound);
 				}
 				GroupEntity newDefaultGroup = (GroupEntity)getGroupQueryList.get(0);
 				newDefaultGroup.setDefaultGroup(true);
@@ -2694,15 +2406,14 @@
 				Query setAllGroupsNotDefault = em.createQuery("UPDATE GroupEntity g SET g.defaultGroup=:defaultGroup WHERE g.deleted=:deleted AND g.groupKey<>:groupKey");
 				//not going to set modified by for all groups
 				setAllGroupsNotDefault.setParameter("defaultGroup", false);
-				setAllGroupsNotDefault.setParameter("deleted", false);
+				setAllGroupsNotDefault.setParameter(deletedVar, false);
 				setAllGroupsNotDefault.setParameter("groupKey", newDefaultGroup.getGroupKey());
 				try{
 					logger.info("set " + setAllGroupsNotDefault.executeUpdate() + " groups as not default");
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception on setAllGroupsNotDefault.executeUpdate()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception on setAllGroupsNotDefault.executeUpdate()");
 					throw new PersistenceException("Could not set all other groups default to false");
 				}
-
 				em.flush();
 			}
 		}
@@ -2724,52 +2435,52 @@
 			}
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query deleteGroupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				deleteGroupQuery.setParameter("groupId", group.getId());
-				deleteGroupQuery.setParameter("deleted", false);
+				Query deleteGroupQuery = em.createQuery(groupEntitySelectQuery);
+				deleteGroupQuery.setParameter(groupIdVar, group.getId());
+				deleteGroupQuery.setParameter(deletedVar, false);
 				List<?> deleteGroupQueryList;
 				try{
 					deleteGroupQueryList = deleteGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if group exists deleteGroupQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if group exists deleteGroupQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to check if group exists");
 				}
-				if(deleteGroupQueryList.size() < 1){
-					logger.warn("The group could not be found with id " + group.getId());
+				if(deleteGroupQueryList.isEmpty()){
+					logger.warn(groupCannotBeFound + group.getId());
 					return;
 				} else if(deleteGroupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the id "+group.getId()+" were found in the database that are not deleted");
-					throw new PersistenceException("Somehow, more than one group with the id "+group.getId()+" were found in the database that are not deleted");
+					PolicyLogger.error(duplicateGroupId+group.getId()+foundInDBNotDeleted);
+					throw new PersistenceException(duplicateGroupId+group.getId()+foundInDBNotDeleted);
 				}				
 
 				Query pdpsInGroupQuery = em.createQuery("SELECT p FROM PdpEntity p WHERE p.groupEntity=:group and p.deleted=:deleted");
 				pdpsInGroupQuery.setParameter("group", ((GroupEntity)deleteGroupQueryList.get(0)));
-				pdpsInGroupQuery.setParameter("deleted", false);
+				pdpsInGroupQuery.setParameter(deletedVar, false);
 				List<?> pdpsInGroupList;
 				try{
 					pdpsInGroupList = pdpsInGroupQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to get PDPs in group on pdpsInGroupQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to get PDPs in group on pdpsInGroupQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to get PDPs in group");
 				}
-				if(pdpsInGroupList.size() > 0){
+				if(!pdpsInGroupList.isEmpty()){
 					if(moveToGroup != null){
 						Query checkMoveToGroupQuery = em.createQuery("SELECT o FROM GroupEntity o WHERE o.groupId=:groupId AND o.deleted=:deleted");
-						checkMoveToGroupQuery.setParameter("groupId", moveToGroup.getId());
-						checkMoveToGroupQuery.setParameter("deleted", false);
+						checkMoveToGroupQuery.setParameter(groupIdVar, moveToGroup.getId());
+						checkMoveToGroupQuery.setParameter(deletedVar, false);
 						List<?> checkMoveToGroupList;
 						try{
 							checkMoveToGroupList = checkMoveToGroupQuery.getResultList();
 						} catch(Exception e){
-							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if group exists checkMoveToGroupQuery.getResultList()");
+							PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if group exists checkMoveToGroupQuery.getResultList()");
 							throw new PersistenceException("Query failed trying to check if group exists");
 						}
-						if(checkMoveToGroupList.size() < 1){
-							PolicyLogger.error("The group could not be found with id " + moveToGroup.getId());
-							throw new PersistenceException("The group could not be found with id " + moveToGroup.getId());
+						if(checkMoveToGroupList.isEmpty()){
+							PolicyLogger.error(groupCannotBeFound + moveToGroup.getId());
+							throw new PersistenceException(groupCannotBeFound + moveToGroup.getId());
 						} else if(checkMoveToGroupList.size() > 1){
-							PolicyLogger.error("Somehow, more than one group with the id "+moveToGroup.getId()+" were found in the database that are not deleted");
-							throw new PersistenceException("Somehow, more than one group with the id "+moveToGroup.getId()+" were found in the database that are not deleted");
+							PolicyLogger.error(duplicateGroupId+moveToGroup.getId()+foundInDBNotDeleted);
+							throw new PersistenceException(duplicateGroupId+moveToGroup.getId()+foundInDBNotDeleted);
 						} else {
 							GroupEntity newGroup = (GroupEntity)checkMoveToGroupList.get(0);
 							for(Object pdpObject : pdpsInGroupList){
@@ -2779,11 +2490,10 @@
 									pdp.setModifiedBy(username);
 								}
 								try{
-
 									em.flush();
 									this.newGroupId = newGroup.getGroupId();
 								} catch(PersistenceException e){
-									PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught PersistenceException trying to set pdp group to null on em.flush()");
+									PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught PersistenceException trying to set pdp group to null on em.flush()");
 									throw new PersistenceException("Query failed trying to set pdp group to ");
 								}
 							}
@@ -2814,22 +2524,22 @@
 			synchronized(emLock){
 				checkBeforeOperationRun();
 				//check if group exists
-				Query groupQuery = em.createQuery("SELECT g FROM GroupEntity g WHERE g.groupId=:groupId AND g.deleted=:deleted");
-				groupQuery.setParameter("groupId", groupID);
-				groupQuery.setParameter("deleted", false);
+				Query groupQuery = em.createQuery(groupEntitySelectQuery);
+				groupQuery.setParameter(groupIdVar, groupID);
+				groupQuery.setParameter(deletedVar, false);
 				List<?> groupQueryList;
 				try{
 					groupQueryList = groupQuery.getResultList();
 				}catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if group exists groupQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if group exists groupQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to check if group "+groupID+" exists");
 				}
-				if(groupQueryList.size() < 1){
+				if(groupQueryList.isEmpty()){
 					PolicyLogger.error("Group policy is being added to does not exist with id "+groupID);
 					throw new PersistenceException("Group policy is being added to does not exist with id "+groupID);
 				} else if(groupQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one group with the id "+groupID+" were found in the database that are not deleted");
-					throw new PersistenceException("Somehow, more than one group with the id "+groupID+" were found in the database that are not deleted");
+					PolicyLogger.error(duplicateGroupId+groupID+foundInDBNotDeleted);
+					throw new PersistenceException(duplicateGroupId+groupID+foundInDBNotDeleted);
 				}
 								
 				//we need to convert the form of the policy id that is used groups into the form that is used 
@@ -2837,22 +2547,22 @@
 				String[] policyNameScopeAndVersion = getNameScopeAndVersionFromPdpPolicy(policyID);			
 				Query policyQuery = em.createQuery("SELECT p FROM PolicyEntity p WHERE p.policyName=:policyName AND p.scope=:scope AND p.deleted=:deleted");
 				policyQuery.setParameter("policyName", policyNameScopeAndVersion[0]);
-				policyQuery.setParameter("scope", policyNameScopeAndVersion[1]);			
-				policyQuery.setParameter("deleted", false);
+				policyQuery.setParameter(scope, policyNameScopeAndVersion[1]);			
+				policyQuery.setParameter(deletedVar, false);
 				List<?> policyQueryList;
 				try{
 					policyQueryList = policyQuery.getResultList();
 				} catch(Exception e){
 					logger.debug(e);
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if policy exists policyQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if policy exists policyQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to check if policy "+policyNameScopeAndVersion[0]+" exists");
 				}
-				if(policyQueryList.size() < 1){
+				if(policyQueryList.isEmpty()){
 					PolicyLogger.error("Policy being added to the group does not exist with policy id "+policyNameScopeAndVersion[0]);
 					throw new PersistenceException("Policy being added to the group does not exist with policy id "+policyNameScopeAndVersion[0]);				
 				} else if(policyQueryList.size() > 1){
-					PolicyLogger.error("Somehow, more than one policy with the id "+policyNameScopeAndVersion[0]+" were found in the database that are not deleted");
-					throw new PersistenceException("Somehow, more than one group with the id "+policyNameScopeAndVersion[0]+" were found in the database that are not deleted");
+					PolicyLogger.error(duplicatePolicyId+policyNameScopeAndVersion[0]+foundInDBNotDeleted);
+					throw new PersistenceException(duplicateGroupId+policyNameScopeAndVersion[0]+foundInDBNotDeleted);
 				}
 				logger.info("PolicyDBDao: Getting group and policy from database");
 				GroupEntity group = (GroupEntity)groupQueryList.get(0);
@@ -2877,17 +2587,14 @@
 				em.flush();
 				
 				// After adding policy to the db group we need to make sure the filesytem group is in sync with the db group
-				StdPDPGroup pdpGroup = null;
-				StdPDPGroup updatedGroup = null;
 				try {
-					pdpGroup = (StdPDPGroup) papEngine.getGroup(group.getGroupId());
-					updatedGroup = synchronizeGroupPoliciesInFileSystem(pdpGroup, group);
+					StdPDPGroup pdpGroup = (StdPDPGroup) papEngine.getGroup(group.getGroupId());
+					return synchronizeGroupPoliciesInFileSystem(pdpGroup, group);
 				} catch (PAPException e) {
 					logger.debug(e);
 					PolicyLogger.error("PolicyDBDao: Could not synchronize the filesystem group with the database group. " + e.getMessage());
 				}
-
-				return updatedGroup;
+				return null;
 			}
 		}
 
@@ -2900,20 +2607,20 @@
 			}
 			synchronized(emLock){
 				checkBeforeOperationRun();
-				Query pdpQuery = em.createQuery("SELECT p FROM PdpEntity p WHERE p.pdpId=:pdpId AND p.deleted=:deleted");
-				pdpQuery.setParameter("pdpId", pdpID);
-				pdpQuery.setParameter("deleted", false);
+				Query pdpQuery = em.createQuery(pdpEntitySelectQuery);
+				pdpQuery.setParameter(pdpIdVariable, pdpID);
+				pdpQuery.setParameter(deletedVar, false);
 				List<?> pdpList;
 				try{
 					pdpList = pdpQuery.getResultList();
 				} catch(Exception e){
-					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyDBDao", "Caught Exception trying to check if pdp exists  pdpQuery.getResultList()");
+					PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if pdp exists  pdpQuery.getResultList()");
 					throw new PersistenceException("Query failed trying to check if pdp "+pdpID+" exists");
 				}
 				if(pdpList.size() > 1){
-					PolicyLogger.error("Somehow, more than one pdp with the id "+pdpID+" were found in the database that are not deleted");
-					throw new PersistenceException("Somehow, more than one pdp with the id "+pdpID+" were found in the database that are not deleted");
-				} else if(pdpList.size() < 1){
+					PolicyLogger.error("Somehow, more than one pdp with the id "+pdpID+foundInDBNotDeleted);
+					throw new PersistenceException("Somehow, more than one pdp with the id "+pdpID+foundInDBNotDeleted);
+				} else if(pdpList.isEmpty()){
 					PolicyLogger.error("Pdp being removed does not exist with id "+pdpID);
 					return;
 				}
@@ -2931,7 +2638,7 @@
 	}
 
 	private PolicyDBDao(){
-
+		//empty constructor
 	}
 	
 	public static PolicyDBDaoTestClass getPolicyDBDaoTestClass(){
@@ -2942,15 +2649,9 @@
 		String getConfigFile(String filename, String scope, PolicyRestAdapter policy){
 			return scope + "." + PolicyDBDao.this.getConfigFile(filename, policy);
 		}
-		String computeScope(String fullPath, String pathToExclude){
-			return PolicyDBDao.computeScope(fullPath, pathToExclude);
-		}
-		String getDescriptionFromXacml(String xacmlData){
-			return PolicyDBDao.getDescriptionFromXacml(xacmlData);
-		}
         String[] getPolicyNameAndVersionFromPolicyFileName(String originalPolicyName) throws PolicyDBException{
             return PolicyDBDao.this.getPolicyNameAndVersionFromPolicyFileName(originalPolicyName);
         }
 	}
 
-}
\ No newline at end of file
+}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java
index 70b8e80..8bfcab9 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java
@@ -58,17 +58,6 @@
 	 */
 	public boolean isTransactionOpen();
 	
-	
-	
-	/**
-	 * Delete an existing policy
-	 * @param policyToDelete The file path of the policy to delete
-	 * @throws IllegalArgumentException If the file path given can not be parsed
-	 * @throws IllegalStateException If a transaction is open that has not yet been committed
-	 * @throws PolicyDBException If a database error occurs
-	 */
-	public void deletePolicy(String policyToDelete) throws PolicyDBException;
-	
 	/**
 	 * Rollback (undo) the current transaction.
 	 */
@@ -184,9 +173,4 @@
 	public GroupEntity getGroup(String groupId);
 	public List<?> getPdpsInGroup(long groupKey);
 	public PdpEntity getPdp(long pdpKey);
-
-	void renamePolicy(String oldPath, String newPath,String username);
-
-	void clonePolicy(String oldPolicyPath, String newPolicyPath, String username);
-		
 }
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java
deleted file mode 100644
index 23aa761..0000000
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP-PAP-REST
- * ================================================================================
- * Copyright (C) 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.policy.pap.xacml.rest.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
-import org.onap.policy.pap.xacml.rest.util.PolicyContainer;
-import org.onap.policy.pap.xacml.rest.util.PolicyItemSetChangeNotifier;
-import org.onap.policy.xacml.api.XACMLErrorConstants;
-import org.onap.policy.xacml.std.pap.StdPDPPolicy;
-
-import com.att.research.xacml.api.pap.PDP;
-import com.att.research.xacml.api.pap.PDPGroup;
-import com.att.research.xacml.api.pap.PDPPolicy;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed {
-	private static final long serialVersionUID = 1L;
-	private static Logger logger	= FlexLogger.getLogger(PDPPolicyContainer.class);
-	
-	 /**
-     * String identifier of a file's "Id" property.
-     */
-    public static final String PROPERTY_ID = "Id";
-
-   /**
-     * String identifier of a file's "name" property.
-     */
-    public static final String PROPERTY_NAME = "Name";
-
-    /**
-      * String identifier of a file's "name" property.
-      */
-     public static final String PROPERTY_VERSION = "Version";
-     
-    /**
-     * String identifier of a file's "Description" property.
-     */
-    public static final String PROPERTY_DESCRIPTION = "Description";
-    
-    /**
-     * String identifier of a file's "IsRoot" property.
-     */
-    public static final String PROPERTY_ISROOT = "Root";
-
-    /**
-     * List of the string identifiers for the available properties.
-     */
-    private static Collection<String> pdpPolicyProperties;
- 
-    private final transient Object data;
-    private transient List<PDPPolicy> policies;
-    
-	@SuppressWarnings("unchecked")
-	public PDPPolicyContainer(Object data) {
-		super();
-		this.data = data;
-		if (this.data instanceof PDPGroup) {
-			policies = new ArrayList<> (((PDPGroup) this.data).getPolicies());
-		}
-		if (this.data instanceof PDP) {
-			policies = new ArrayList<> (((PDP) this.data).getPolicies());
-		}
-		if (this.data instanceof Set) {
-			policies = new ArrayList<> ((Set<PDPPolicy>)data);
-		}
-		if (this.policies == null) {
-			logger.info("NULL policies");
-			throw new NullPointerException("PDPPolicyContainer created with unexpected Object type '" + data.getClass().getName() + "'");
-		}
-		this.setContainer(this);
-	}
-	
-	@Override
-	public Object nextItemId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("nextItemId: " + itemId);
-		}
-		int index = this.policies.indexOf(itemId);
-		if (index == -1 || ((index + 1) >= this.policies.size())) {
-			return null;
-		}		
-		return new PDPPolicyItem(this.policies.get(index + 1));
-	}
-
-	@Override
-	public Object prevItemId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("prevItemId: " + itemId);
-		}
-		int index = this.policies.indexOf(itemId);
-		if (index <= 0) {
-			return null;
-		}
-		return new PDPPolicyItem(this.policies.get(index - 1));
-	}
-
-	@Override
-	public Object firstItemId() {
-		if (logger.isTraceEnabled()) {
-			logger.trace("firstItemId: ");
-		}
-		if (this.policies.isEmpty()) {
-			return null;
-		}
-		return new PDPPolicyItem(this.policies.get(0));
-	}
-
-	@Override
-	public Object lastItemId() {
-		if (logger.isTraceEnabled()) {
-			logger.trace("lastItemid: ");
-		}
-		if (this.policies.isEmpty()) {
-			return null;
-		}
-		return new PDPPolicyItem(this.policies.get(this.policies.size() - 1));
-	}
-
-	@Override
-	public boolean isFirstId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("isFirstId: " + itemId);
-		}
-		if (this.policies.isEmpty()) {
-			return false;
-		}
-		return (itemId.equals(this.policies.get(0)));
-	}
-
-	@Override
-	public boolean isLastId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("isLastId: " + itemId);
-		}
-		if (this.policies.isEmpty()) {
-			return false;
-		}
-		return (itemId.equals(this.policies.get(this.policies.size() - 1)));
-	}
-
-	@Override
-	public Object addItemAfter(Object previousItemId){
-		return null;
-	}
-
-	@Override
-	public Collection<?> getContainerPropertyIds() {
-		return pdpPolicyProperties;
-	}
-
-	@Override
-	public Collection<?> getItemIds() {
-		final Collection<Object> items = new ArrayList<>();
-		items.addAll(this.policies);
-		return Collections.unmodifiableCollection(items);
-	}
-	
-	
-	@Override
-	public Class<?> getType(Object propertyId) {
-        if (propertyId.equals(PROPERTY_ID)) {
-            return String.class;
-        }
-        if (propertyId.equals(PROPERTY_NAME)) {
-            return String.class;
-        }
-        if (propertyId.equals(PROPERTY_VERSION)) {
-            return String.class;
-        }
-        if (propertyId.equals(PROPERTY_DESCRIPTION)) {
-            return String.class;
-        }
-        if (propertyId.equals(PROPERTY_ISROOT)) {
-            return Boolean.class;
-        }
-		return null;
-	}
-
-	@Override
-	public int size() {
-		if (logger.isTraceEnabled()) {
-			logger.trace("size: " + this.policies.size());
-		}
-		return this.policies.size();
-	}
-
-	@Override
-	public boolean containsId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("containsId: " + itemId);
-		}
-		return this.policies.contains(itemId);
-	}
-
-	@Override
-	public Object addItem(){
-		throw new UnsupportedOperationException("Cannot add an empty policy.");
-	}
-
-	@Override
-	public boolean removeItem(Object itemId){
-		if (logger.isTraceEnabled()) {
-			logger.trace("removeItem: " + itemId);
-		}
-		ObjectMapper mapper = new ObjectMapper();
-		mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-		StdPDPPolicy pdpPolicy = null;
-		try {
-			pdpPolicy = mapper.readValue(itemId.toString() , StdPDPPolicy.class);
-			for(int i = 0; i< policies.size(); i++){
-				if(policies.get(i).getId().equalsIgnoreCase(pdpPolicy.getId())){
-					return this.policies.remove(this.policies.get(i));
-				}
-			}
-		} catch (Exception e) {
-			logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Mapping the Removing Policy from PDP Group to Std Policy"+e);
-		}	
-		return this.policies.remove(itemId);
-	}
-
-	@Override
-	public boolean addContainerProperty(Object propertyId, Class<?> type,
-			Object defaultValue){
-		return false;
-	}
-
-	@Override
-	public boolean removeContainerProperty(Object propertyId){
-		return false;
-	}
-
-	@Override
-	public boolean removeAllItems(){
-		return false;
-	}
-
-	@Override
-	public int indexOfId(Object itemId) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("indexOfId: " + itemId);
-		}
-		return this.policies.indexOf(itemId);
-	}
-
-	@Override
-	public Object getIdByIndex(int index) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("getIdByIndex: " + index);
-		}
-		return this.policies.get(index);
-	}
-
-	@Override
-	public List<?> getItemIds(int startIndex, int numberOfItems) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("getItemIds: " + startIndex + " " + numberOfItems);
-		}
-		if (numberOfItems < 0) {
-			throw new IllegalArgumentException();
-		}
-		return this.policies.subList(startIndex, startIndex + numberOfItems);
-	}
-
-	@Override
-	public Object addItemAt(int index) {
-		if (logger.isTraceEnabled()) {
-			logger.trace("addItemAt: " + index);
-		}
-		return null;
-	}
-
-	public class PDPPolicyItem {
-		private final PDPPolicy policy;
-		
-		public PDPPolicyItem(PDPPolicy itemId) {
-			this.policy = itemId;
-		}
-
-		public String getId() {
-			if (logger.isTraceEnabled()) {
-				logger.trace("getId: " + this.policy);
-			}
-			return this.policy.getId();
-		}
-		
-		public String getName() {
-			if (logger.isTraceEnabled()) {
-				logger.trace("getName: " + this.policy);
-			}
-			return this.policy.getName();
-		}
-		
-		public String getVersion() {
-			if (logger.isTraceEnabled()) {
-				logger.trace("getVersion: " + this.policy);
-			}
-			return this.policy.getVersion();
-		}
-		
-		public String getDescription() {
-			if (logger.isTraceEnabled()) {
-				logger.trace("getDescription: " + this.policy);
-			}
-			return this.policy.getDescription();
-		}
-		
-		public boolean getRoot() {
-			if (logger.isTraceEnabled()) {
-				logger.trace("isRoot: " + this.policy);
-			}
-			return this.policy.isRoot();
-		}
-		
-		public void setRoot(Boolean root) {
-			((StdPDPPolicy)this.policy).setRoot(root);
-		}
-	
-	}
-}
\ No newline at end of file
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/RemoveGroupPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/RemoveGroupPolicy.java
index d05a1ab..8c891bf 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/RemoveGroupPolicy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/RemoveGroupPolicy.java
@@ -24,6 +24,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import org.onap.policy.rest.util.PDPPolicyContainer;
 import org.onap.policy.xacml.api.pap.OnapPDPGroup;
 import org.onap.policy.xacml.std.pap.StdPDPGroup;
 
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
index 415c779..48f67aa 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
@@ -123,33 +123,33 @@
 			String policyType = policyData.getPolicyType();
 
 			String filePrefix = null;
-			if (policyType.equalsIgnoreCase("Config")) {
+			if ("Config".equalsIgnoreCase(policyType)) {
 				policyConfigType = policyData.getConfigPolicyType();
-				if (policyConfigType.equalsIgnoreCase("Firewall Config")) {
+				if ("Firewall Config".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_FW_";
-				}else if (policyConfigType.equalsIgnoreCase("ClosedLoop_Fault")) {
+				}else if ("ClosedLoop_Fault".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_Fault_";
-				}else if (policyConfigType.equalsIgnoreCase("ClosedLoop_PM")) {
+				}else if ("ClosedLoop_PM".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_PM_";
-				}else if (policyConfigType.equalsIgnoreCase("Micro Service")) {
+				}else if ("Micro Service".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_MS_";
-				}else if (policyConfigType.equalsIgnoreCase("BRMS_Raw")) {
+				}else if ("BRMS_Raw".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_BRMS_Raw_";
-				}else if (policyConfigType.equalsIgnoreCase("BRMS_Param")) {
+				}else if ("BRMS_Param".equalsIgnoreCase(policyConfigType)) {
 					filePrefix = "Config_BRMS_Param_";
 				}else {
 					filePrefix = "Config_"; 
 				}
-			} else if (policyType.equalsIgnoreCase("Action")) {
+			} else if ("Action".equalsIgnoreCase(policyType)) {
 				filePrefix = "Action_";
-			} else if (policyType.equalsIgnoreCase("Decision")) {
+			} else if ("Decision".equalsIgnoreCase(policyType)) {
 				filePrefix = "Decision_";
 			}
 
 			int version = 0;
 			int highestVersion = 0;
-			String createdBy = "";
-			String modifiedBy = userId;
+			String createdBy;
+			String modifiedBy;
 			String scopeCheck = policyData.getDomainDir().replace(".", File.separator);
 			PolicyEditorScopes policyEditorScope = (PolicyEditorScopes) commonClassDao.getEntityItem(PolicyEditorScopes.class, "scopeName", scopeCheck);
 			if(policyEditorScope == null){
@@ -192,7 +192,7 @@
 					response.setStatus(HttpServletResponse.SC_CONFLICT);
 					response.addHeader("error", "policyExists");
 					response.addHeader("policyName", policyData.getPolicyName());
-					return new ResponseEntity<String>(body, status);
+					return new ResponseEntity<>(body, status);
 				}		
 			}else{
 				// if policy does not exist and the request is updatePolicy return error
@@ -261,7 +261,7 @@
 					if(policyData.getApiflag() == null){
 						// If there is any dynamic field create the matches here
 						String key="templateName";
-						String value=(String) policyData.getRuleName();
+						String value= policyData.getRuleName();
 						drlRuleAndUIParams.put(key, value);
 						if(policyData.getRuleData().size() > 0){
 							for(Object keyValue: policyData.getRuleData().keySet()){
@@ -360,7 +360,7 @@
 						policyData.setActionDictMethod(jsonData.getMethod());
 					}
 				}
-				newPolicy = new ActionPolicy(policyData);
+				newPolicy = new ActionPolicy(policyData, commonClassDao);
 			} else if (policyType.equalsIgnoreCase("Decision")) {
 				if(policyData.getApiflag() == null){
 					Map<String, String> settingsMap = new HashMap<>();
@@ -374,7 +374,7 @@
 					List<String> errorCodeList = new LinkedList<>();
 					List<String> treatmentList = new LinkedList<>();
 
-					if(policyData.getSettings().size() > 0){
+					if(!policyData.getSettings().isEmpty()){
 						for(Object settingsData : policyData.getSettings()){
 							if(settingsData instanceof LinkedHashMap<?, ?>){
 								String key = ((LinkedHashMap<?, ?>) settingsData).get("key").toString();
@@ -445,7 +445,7 @@
 					policyData.setErrorCodeList(errorCodeList);
 					policyData.setTreatmentList(treatmentList);
 				}
-				newPolicy = new DecisionPolicy(policyData);
+				newPolicy = new DecisionPolicy(policyData, commonClassDao);
 			}
 
 			if(newPolicy != null){
@@ -455,7 +455,7 @@
 				status = HttpStatus.INTERNAL_SERVER_ERROR;
 				response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);								
 				response.addHeader("error", "error");
-				return new ResponseEntity<String>(body, status);
+				return new ResponseEntity<>(body, status);
 			}
 			
 			PolicyDBDaoTransaction policyDBDaoTransaction = null;
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/JPAUtils.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/JPAUtils.java
index e18ca9e..22c44a8 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/JPAUtils.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/JPAUtils.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -20,25 +20,13 @@
 
 package org.onap.policy.pap.xacml.rest.util;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.Query;
-import javax.servlet.ServletException;
 
 import org.onap.policy.rest.XacmlAdminAuthorization;
-import org.onap.policy.rest.jpa.Attribute;
-import org.onap.policy.rest.jpa.Datatype;
-import org.onap.policy.rest.jpa.FunctionDefinition;
 import org.onap.policy.rest.jpa.GlobalRoleSettings;
 
-import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType;
-import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType;
-
 import org.onap.policy.common.logging.flexlogger.FlexLogger; 
 import org.onap.policy.common.logging.flexlogger.Logger;
 
@@ -46,9 +34,6 @@
 	private static final Logger LOGGER	= FlexLogger.getLogger(JPAUtils.class);
 	
 	private static EntityManagerFactory emf;
-	private static final Object mapAccess = new Object();
-	private static Map<Datatype, List<FunctionDefinition>> mapDatatype2Function = null;
-	private static Map<String, FunctionDefinition> mapID2Function = null;
 	private static JPAUtils currentInstance = null;
 	
 	
@@ -77,109 +62,6 @@
 	}
 	
 	/**
-	 * Gets the current instance of JPAUtils. 
-	 * @return The instance of JPAUtils or throws exception if the given instance is null.
-	 * @throws IllegalStateException if a JPAUtils instance is null. Call getJPAUtilsInstance(EntityManagerFactory emf) to get this.
-	 */
-	public static JPAUtils getJPAUtilsInstance(){
-		LOGGER.debug("getJPAUtilsInstance() as getJPAUtilsInstance() called");
-		if(currentInstance != null){
-			return currentInstance;
-		}
-		throw new IllegalStateException("The JPAUtils.currentInstance is Null.  Use getJPAUtilsInstance(EntityManagerFactory emf)");
-	}
-	
-	public static AttributeDesignatorType createDesignator(Attribute attribute) {
-		AttributeDesignatorType designator = new AttributeDesignatorType();
-		designator.setAttributeId(attribute.getXacmlId());
-		if (attribute.getCategoryBean() != null) {
-			designator.setCategory(attribute.getCategoryBean().getXacmlId());
-		} else {
-			LOGGER.warn("No category bean");
-		}
-		if (attribute.getDatatypeBean() != null) {
-			designator.setDataType(attribute.getDatatypeBean().getXacmlId());
-		} else {
-			LOGGER.warn("No datatype bean");
-		}
-		designator.setIssuer(attribute.getIssuer());
-		designator.setMustBePresent(attribute.isMustBePresent());
-		return designator;
-	}
-		
-	public static AttributeSelectorType	createSelector(Attribute attribute) {
-		AttributeSelectorType selector = new AttributeSelectorType();
-		selector.setContextSelectorId(attribute.getXacmlId());
-		selector.setPath(attribute.getSelectorPath());
-		if (attribute.getCategoryBean() != null) {
-			selector.setCategory(attribute.getCategoryBean().getXacmlId());
-		} else {
-			LOGGER.warn("No category bean");
-		}
-		if (attribute.getDatatypeBean() != null) {
-			selector.setDataType(attribute.getDatatypeBean().getXacmlId());
-		} else {
-			LOGGER.warn("No datatype bean");
-		}
-		selector.setMustBePresent(attribute.isMustBePresent());
-		return selector;
-	}
-	
-	/**
-	 * Builds a map in memory of a functions return datatype to function definition. Useful in limiting the number
-	 * of SQL calls to DB especially when we don't expect these to change much.
-	 * 
-	 * @return - A HashMap of Datatype JPA Container ID's to FunctionDefinition objects
-	 */
-	public Map<Datatype, List<FunctionDefinition>>	getFunctionDatatypeMap() {		
-		
-		synchronized(mapAccess) {
-			if (mapDatatype2Function == null||mapDatatype2Function.isEmpty()) {
-				try {
-					buildFunctionMaps();
-				} catch (ServletException e) {
-					LOGGER.error("Exception Occured"+e);
-				}
-			}
-		}
-		return mapDatatype2Function;
-	}
-	
-	public Map<String, FunctionDefinition> getFunctionIDMap() {
-		synchronized(mapAccess) {
-			if (mapID2Function == null||mapID2Function.isEmpty()) {
-				try {
-					buildFunctionMaps();
-				} catch (ServletException e) {
-					LOGGER.error("Exception Occured"+e);
-				}
-			}
-		}
-		return mapID2Function;
-	}
-	
-	private static void buildFunctionMaps() throws ServletException {
-		mapDatatype2Function = new HashMap<>();
-		mapID2Function = new HashMap<>();
-
-		EntityManager em = emf.createEntityManager();
-		Query getFunctionDefinitions = em.createNamedQuery("FunctionDefinition.findAll");	
-		List<?> functionList = getFunctionDefinitions.getResultList(); 	
-		
-		for (Object id : functionList) {
-			FunctionDefinition value = (FunctionDefinition)id;
-			mapID2Function.put(value.getXacmlid(), value);
-			if (!mapDatatype2Function.containsKey(value.getDatatypeBean())) {
-				mapDatatype2Function.put(value.getDatatypeBean(), new ArrayList<FunctionDefinition>());
-			}
-			mapDatatype2Function.get(value.getDatatypeBean()).add(value);
-		}
-
-		em.close();
-		
-	}
-	
-	/**
 	 * Returns the lockdown value, in case of exception it is assumed that lockdown functionality
 	 * is not supported and returns false.
 	 * 
@@ -233,7 +115,4 @@
 		
 		return globalRoleSettings.isLockdown();
 	}
-	
-	
-
 }
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyContainer.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyContainer.java
deleted file mode 100644
index 5d2453b..0000000
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyContainer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP Policy Engine
- * ================================================================================
- * Copyright (C) 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.policy.pap.xacml.rest.util;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.List;
-
-
-public interface PolicyContainer extends Serializable{
-	
-    public Collection<?> getContainerPropertyIds();
-    
-    public Collection<?> getItemIds();
-
-    public Class<?> getType(Object propertyId);
-
-    public int size();
-  
-    public boolean containsId(Object itemId);
-
-    public Object addItem() throws UnsupportedOperationException;
-    
-    public boolean removeItem(Object itemId)
-            throws UnsupportedOperationException;
-
-    public boolean addContainerProperty(Object propertyId, Class<?> type,
-            Object defaultValue) throws UnsupportedOperationException;
-   
-    public boolean removeContainerProperty(Object propertyId)
-            throws UnsupportedOperationException;
-
-    public boolean removeAllItems() throws UnsupportedOperationException;
-
-    public interface Ordered extends PolicyContainer {
-
-        public Object nextItemId(Object itemId);
-
-        public Object prevItemId(Object itemId);
-
-        public Object firstItemId();
-
-        public Object lastItemId();
-
-        public boolean isFirstId(Object itemId);
-
-        public boolean isLastId(Object itemId);
-
-        public Object addItemAfter(Object previousItemId)
-                throws UnsupportedOperationException;
-        
-    }
-
-    
-    public interface Indexed extends Ordered {
-
-        public int indexOfId(Object itemId);
-
-        public Object getIdByIndex(int index);
-
-        public List<?> getItemIds(int startIndex, int numberOfItems);
-        
-        public Object addItemAt(int index) throws UnsupportedOperationException;
-
-        public interface ItemAddEvent extends ItemSetChangeEvent {
-
-            public Object getFirstItemId();
-
-            public int getFirstIndex();
-
-            public int getAddedItemsCount();
-        }
-
-     
-        public interface ItemRemoveEvent extends ItemSetChangeEvent {
-          
-            public Object getFirstItemId();
-
-            public int getFirstIndex();
-
-            public int getRemovedItemsCount();
-        }
-    }
-  
-    public interface ItemSetChangeEvent extends Serializable {
-
-        public PolicyContainer getContainer();
-    }
-
-    public interface ItemSetChangeListener extends Serializable {
-
-        public void containerItemSetChange(PolicyContainer.ItemSetChangeEvent event);
-    }
-
-    public interface ItemSetChangeNotifier extends Serializable {
-
-        public void addItemSetChangeListener(
-                PolicyContainer.ItemSetChangeListener listener);
-
-        public void removeItemSetChangeListener(
-                PolicyContainer.ItemSetChangeListener listener);
-    }
-}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyItemSetChangeNotifier.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyItemSetChangeNotifier.java
deleted file mode 100644
index 5d7f785..0000000
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/PolicyItemSetChangeNotifier.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP Policy Engine
- * ================================================================================
- * Copyright (C) 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.policy.pap.xacml.rest.util;
-
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.EventObject;
-import java.util.LinkedList;
-
-import org.onap.policy.pap.xacml.rest.util.PolicyContainer.ItemSetChangeEvent;
-import org.onap.policy.pap.xacml.rest.util.PolicyContainer.ItemSetChangeListener;
-
-
-
-
-public class PolicyItemSetChangeNotifier implements PolicyContainer.ItemSetChangeNotifier {
-	private static final long serialVersionUID = 1L;
-    private Collection<PolicyContainer.ItemSetChangeListener> itemSetChangeListeners = null;
-    private PolicyContainer container = null;
-    
-    public PolicyItemSetChangeNotifier() {
-    }
-    
-    protected void setContainer(PolicyContainer c) {
-    	this.container = c;
-    }
-
-	@Override
-	public void addItemSetChangeListener(ItemSetChangeListener listener) {
-        if (getItemSetChangeListeners() == null) {
-            setItemSetChangeListeners(new LinkedList<PolicyContainer.ItemSetChangeListener>());
-        }
-        getItemSetChangeListeners().add(listener);	}
-
-	@Override
-	public void removeItemSetChangeListener(ItemSetChangeListener listener) {
-        if (getItemSetChangeListeners() != null) {
-            getItemSetChangeListeners().remove(listener);
-        }
-    }
-	
-	protected static class BaseItemSetChangeEvent extends EventObject implements
-	    PolicyContainer.ItemSetChangeEvent, Serializable {
-		private static final long serialVersionUID = 1L;
-
-		protected BaseItemSetChangeEvent(PolicyContainer source) {
-		    super(source);
-		}
-		
-		@Override
-		public PolicyContainer getContainer() {
-		    return (PolicyContainer) getSource();
-		}
-	}
-
-    protected void setItemSetChangeListeners(
-            Collection<PolicyContainer.ItemSetChangeListener> itemSetChangeListeners) {
-        this.itemSetChangeListeners = itemSetChangeListeners;
-    }
-    protected Collection<PolicyContainer.ItemSetChangeListener> getItemSetChangeListeners() {
-        return itemSetChangeListeners;
-    }
-  
-    protected void fireItemSetChange() {
-        fireItemSetChange(new BaseItemSetChangeEvent(this.container));
-    }
-
-    protected void fireItemSetChange(ItemSetChangeEvent event) {
-        if (getItemSetChangeListeners() != null) {
-            final Object[] l = getItemSetChangeListeners().toArray();
-            for (int i = 0; i < l.length; i++) {
-                ((PolicyContainer.ItemSetChangeListener) l[i])
-                        .containerItemSetChange(event);
-            }
-        }
-    }
-}
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/ActionPolicyTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/ActionPolicyTest.java
index 55879ca..cb09bec 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/ActionPolicyTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/ActionPolicyTest.java
@@ -89,7 +89,7 @@
 		attributeMap.put("java", "test");
 		policyAdapter.setDynamicFieldConfigAttributes(attributeMap);
 		
-		component = new ActionPolicy(policyAdapter);
+		component = new ActionPolicy(policyAdapter, null);
 
         logger.info("setUp: exit");
 	}
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java
index caa5707..e16dd98 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/DecisionPolicyTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -19,7 +19,6 @@
  */
 package org.onap.policy.pap.xacml.rest.components;
 
-import static org.junit.Assert.*;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.when;
@@ -30,7 +29,6 @@
 import java.util.Map;
 import java.util.UUID;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -101,19 +99,12 @@
 		policyAdapter.setRainydayMap(treatmentMap);
 		policyAdapter.setRainyday(rainyday);
 			
-		component = new DecisionPolicy(policyAdapter);
+		component = new DecisionPolicy(policyAdapter, null);
 
         logger.info("setUp: exit");
 	}
 
 	/**
-	 * @throws java.lang.Exception
-	 */
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	/**
 	 * Test method for {@link org.openecomp.policy.pap.xacml.rest.components.DecisionPolicy#savePolicies()}.
 	 */
 	@Test
@@ -140,7 +131,7 @@
 	public void testPrepareToSaveRainyDay() {
 		logger.debug("test PrepareToSave Policy: enter");
 		policyAdapter.setRuleProvider("Rainy_Day");
-		component = new DecisionPolicy(policyAdapter);
+		component = new DecisionPolicy(policyAdapter, null);
 		boolean response = false;
 		
 		try {
@@ -150,24 +141,4 @@
 		}
 		assertTrue(response);
 	}
-	
-	/**
-	 * Test method for {@link org.openecomp.policy.pap.xacml.rest.components.DecisionPolicy#prepareToSave()}.
-	 */
-	@Test
-	public void testPrepareToSaveCustom() {
-		logger.debug("test PrepareToSave Policy: enter");
-		policyAdapter.setRuleProvider("Custom");
-		component = new DecisionPolicy(policyAdapter);
-		boolean response = false;
-		
-		try {
-			response = component.prepareToSave();
-		} catch (Exception e) {
-			logger.error("Exception Occured"+e);
-		}
-		assertTrue(response);
-	}
-
-
 }
\ No newline at end of file
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
index 546c5c0..c098bf4 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -20,8 +20,11 @@
 
 package org.onap.policy.pap.xacml.rest.components;
 
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Date;
 import java.util.List;
@@ -36,11 +39,10 @@
 import org.apache.commons.io.IOUtils;
 import org.junit.After;
 import org.junit.Assert;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.mockito.Mockito;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
 import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.pap.xacml.rest.components.PolicyDBDao.PolicyDBDaoTestClass;
@@ -51,14 +53,17 @@
 import org.onap.policy.rest.jpa.PdpEntity;
 import org.onap.policy.rest.jpa.PolicyEntity;
 import org.onap.policy.xacml.api.pap.OnapPDPGroup;
+import org.onap.policy.xacml.std.pap.StdEngine;
 import org.onap.policy.xacml.std.pap.StdPDPGroup;
 import org.onap.policy.xacml.util.XACMLPolicyWriter;
 
+import com.att.research.xacml.api.pap.PAPException;
 import com.att.research.xacml.util.XACMLProperties;
 
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
+import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
 
-public class PolicyDBDaoTest {
+public class PolicyDBDaoTest extends Mockito{
 
 	private static Logger logger = FlexLogger.getLogger(PolicyDBDaoTest.class);
 	
@@ -66,8 +71,11 @@
 	PolicyDBDao dbd;
 	PolicyDBDao dbd2;
 	EntityManagerFactory emf;
+	private Path repository;
+	StdEngine stdEngine = null;
+	
 	@Before
-	public void init(){
+	public void init() throws PAPException, IOException{
 	    System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME,"src/test/resources/xacml.pap.properties");
 		emf = Persistence.createEntityManagerFactory("testPapPU");
 		EntityManager em = emf.createEntityManager();
@@ -90,15 +98,19 @@
 			dbd = PolicyDBDao.getPolicyDBDaoInstance(emf);
 			dbd2 = PolicyDBDao.getPolicyDBDaoInstance(emf);
 		} catch (Exception e) {
-			//logger.error("Exception Occured"+e);
 			Assert.fail();
 		}
 
 		d = PolicyDBDao.getPolicyDBDaoTestClass();
+		PolicyDBDao.setJunit(true);
+		repository = Paths.get("src/test/resources/pdps");
+        stdEngine = new StdEngine(repository);
+        dbd.setPapEngine(stdEngine);
 	}
 	
 	@After
 	public void cleanUp(){
+		PolicyDBDao.setJunit(false);
 		EntityManager em = emf.createEntityManager();
 		em.getTransaction().begin();
 		try{	
@@ -119,15 +131,9 @@
 		} catch (IOException e) {
 			//could not delete
 		}
-
 	}
 	
 	@Test
-	public void computeScopeTest(){
-		Assert.assertEquals("com",d.computeScope("C:\\Users\\testuser\\admin\\repo\\com\\", "C:\\Users\\testuser\\admin\\repo"));
-		Assert.assertEquals("org.onap.policy",d.computeScope("/Users/testuser/admin/repo/org.onap.policy", "/Users/testuser/admin/repo"));
-	}
-	@Test
 	public void getConfigFileTest(){
 		PolicyRestAdapter pra = new PolicyRestAdapter();
 		pra.setConfigType(ConfigPolicy.JSON_CONFIG);
@@ -138,23 +144,33 @@
 		Assert.assertEquals("org.onap.Action_mypolicy.json", configFile);
 	}
 	
-	@Ignore
 	@Test
 	public void createFromPolicyObject(){
-		String workspaceDir = "src/test/resources/";
-		File parentPath = new File(workspaceDir+"/com");
 		Policy policyObject = new ConfigPolicy();
 		policyObject.policyAdapter = new PolicyRestAdapter();
 		policyObject.policyAdapter.setConfigName("testpolicy1");
-		policyObject.policyAdapter.setParentPath(parentPath.getAbsolutePath());
 		policyObject.policyAdapter.setPolicyDescription("my description");
 		policyObject.policyAdapter.setConfigBodyData("this is my test config file");
-		policyObject.policyAdapter.setPolicyName("testpolicy1");
+		policyObject.policyAdapter.setPolicyName("SampleTest1206");
 		policyObject.policyAdapter.setConfigType(ConfigPolicy.OTHER_CONFIG);
 		policyObject.policyAdapter.setPolicyType("Config");
-		policyObject.policyAdapter.setDomainDir("org.onap");
+		policyObject.policyAdapter.setDomainDir("com");
+		policyObject.policyAdapter.setVersion("1");
 		PolicyType policyTypeObject = new PolicyType();
 		policyObject.policyAdapter.setPolicyData(policyTypeObject);
+		ClassLoader classLoader = getClass().getClassLoader();
+		PolicyType policyConfig = new PolicyType();
+        policyConfig.setVersion(Integer.toString(1));
+        policyConfig.setPolicyId("");
+        policyConfig.setTarget(new TargetType());
+        policyObject.policyAdapter.setData(policyConfig);
+		mock(XACMLPolicyWriter.class);
+		try {
+			policyObject.policyAdapter.setParentPath(IOUtils.toString(classLoader.getResourceAsStream("Config_SampleTest1206.1.xml")));
+		} catch (Exception e2) {
+			fail();
+		}
+		
 		PolicyDBDaoTransaction transaction = dbd.getNewTransaction();
 		try{
 			transaction.createPolicy(policyObject, "testuser1");
@@ -166,57 +182,31 @@
 		
 		EntityManager getData = emf.createEntityManager();
 		Query getDataQuery = getData.createQuery("SELECT p FROM PolicyEntity p WHERE p.scope=:scope AND p.policyName=:name");
-		getDataQuery.setParameter("scope", "org.onap");
-		getDataQuery.setParameter("name","Config_testpolicy1.xml");
+		getDataQuery.setParameter("scope", "com");
+		getDataQuery.setParameter("name","Config_SampleTest1206.1.xml");
 		PolicyEntity result = null;
 		try{
-		result = (PolicyEntity)getDataQuery.getSingleResult();
+			result = (PolicyEntity)getDataQuery.getSingleResult();
 		} catch(Exception e){
 			logger.error("Exception Occured"+e);
 			Assert.fail();
 		}
 		String expectedData;
 		try {
-			expectedData = IOUtils.toString(XACMLPolicyWriter.getXmlAsInputStream(policyTypeObject));
+			expectedData = IOUtils.toString(classLoader.getResourceAsStream("Config_SampleTest1206.1.xml"));
 		} catch (IOException e1) {
 			expectedData = "";
 		}
 		Assert.assertEquals(expectedData, result.getPolicyData());
 		getData.close();
 		result = null;
-		File policyFile = new File(workspaceDir+"/org/onap/Config_testpolicy1.xml");
-		try{
-			transaction = dbd.getNewTransaction();
-			transaction.deletePolicy(policyFile.getAbsolutePath());
-		} catch(Exception e){
-			logger.error("Exception Occured"+e);
-			Assert.fail();
-		}
-		Assert.assertTrue(transaction.isTransactionOpen());
-		try{				
-			transaction.deletePolicy(policyFile.getAbsolutePath());
-			Assert.fail();
-		} catch(IllegalStateException e){
-			//pass
-		} catch(Exception e){
-			Assert.fail();
-		}
+
 		transaction.commitTransaction();
 		Assert.assertFalse(transaction.isTransactionOpen());
-		try{
-			transaction = dbd.getNewTransaction();
-			transaction.deletePolicy(policyFile.getAbsolutePath());
-		} catch(Exception e){
-			logger.error("Exception Occured"+e);
-			Assert.fail();
-		}
-		//Assert.assertFalse(transaction.isTransactionOpen());
-		transaction.commitTransaction();
 	}
 
-	@Ignore
 	@Test
-	public void groupTransactions(){		
+	public void groupTransactions(){
 		PolicyDBDaoTransaction group = dbd.getNewTransaction();
 		String groupName = "test group 1";
 		try{
@@ -405,9 +395,6 @@
 			Assert.fail();
 		}
 		
-		
-		//add policy to group
-		
 		//update group
 		OnapPDPGroup pdpGroup = new StdPDPGroup("testgroup2", false, "newtestgroup2", "this is my new description", Paths.get("/"));
 		group = dbd.getNewTransaction();
@@ -441,12 +428,6 @@
 		em.close();
 	}
 	
-	@Test
-	public void getDescriptionFromXacmlTest(){
-		String myTestDesc = "hello this is a test";
-		String desc = d.getDescriptionFromXacml("<Description>"+myTestDesc+"</Description>");
-		Assert.assertEquals(myTestDesc, desc);
-	}
 	@Ignore
 	@Test
 	public void threadingStabilityTest(){
@@ -618,4 +599,4 @@
 		}
 	}
 
-}
+}
\ No newline at end of file
diff --git a/ONAP-PAP-REST/src/test/resources/Config_SampleTest1206.1.xml b/ONAP-PAP-REST/src/test/resources/Config_SampleTest1206.1.xml
new file mode 100644
index 0000000..dcfd0c5
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/resources/Config_SampleTest1206.1.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:com:xacml:policy:id:0b67998b-57e2-4e25-9ea9-f9154bf18df1" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides">
+    <Description>SampleTest1206@CreatedBy:test@CreatedBy:@ModifiedBy:test@ModifiedBy:</Description>
+    <Target>
+        <AnyOf>
+            <AllOf>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">com.Config_SampleTest1206.1.xml</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="PolicyName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+            </AllOf>
+            <AllOf>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">success</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="ONAPName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">PROD</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="RiskType" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="RiskLevel" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">True</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="guard" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">08-06-2017</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="TTLDate" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleTest1206</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="ConfigName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+            </AllOf>
+        </AnyOf>
+    </Target>
+    <Rule RuleId="urn:com:xacml:rule:id:7e46d503-af54-4ea5-a86c-9eb6dd1f4f43" Effect="Permit">
+        <Target>
+            <AnyOf>
+                <AllOf>
+                    <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case">
+                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ACCESS</AttributeValue>
+                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                    </Match>
+                    <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case">
+                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Config</AttributeValue>
+                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                    </Match>
+                </AllOf>
+            </AnyOf>
+        </Target>
+        <AdviceExpressions>
+            <AdviceExpression AdviceId="configID" AppliesTo="Permit">
+                <AttributeAssignmentExpression AttributeId="type" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Configuration</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="URLID" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#anyURI">$URL/Config/com.Config_SampleTest1206.1.txt</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="PolicyName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">com.Config_SampleTest1206.1.xml</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="VersionNumber" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="matching:ONAPName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">success</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="matching:ConfigName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleTest1206</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="RiskType" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">PROD</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="RiskLevel" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="guard" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">True</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="TTLDate" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">08-06-2017</AttributeValue>
+                </AttributeAssignmentExpression>
+            </AdviceExpression>
+        </AdviceExpressions>
+    </Rule>
+</Policy>
diff --git a/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/com.Config_SampleBasePolicy.1.xml b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/com.Config_SampleBasePolicy.1.xml
new file mode 100644
index 0000000..168cb55
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/com.Config_SampleBasePolicy.1.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:xacml:policy:id:0bc4aa91-cb41-420a-93e1-eca6098797a3" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides">
+    <Description>SampleBasePolicy@CreatedBy:demo@CreatedBy:@ModifiedBy:demo@ModifiedBy:</Description>
+    <Target>
+        <AnyOf>
+            <AllOf>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">com.Config_SampleBasePolicy.1.xml</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="PolicyName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+            </AllOf>
+            <AllOf>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ONAP_TEST_123</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="ONAPName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleRiskType</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="RiskType" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="RiskLevel" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">False</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="guard" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">17-01-2018</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="TTLDate" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+                <Match MatchId="org.onap.function.regex-match">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleBasePolicy</AttributeValue>
+                    <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="ConfigName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                </Match>
+            </AllOf>
+        </AnyOf>
+    </Target>
+    <Rule RuleId="" Effect="Permit">
+        <Target>
+            <AnyOf>
+                <AllOf>
+                    <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case">
+                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ACCESS</AttributeValue>
+                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                    </Match>
+                    <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case">
+                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Config</AttributeValue>
+                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
+                    </Match>
+                </AllOf>
+            </AnyOf>
+        </Target>
+        <AdviceExpressions>
+            <AdviceExpression AdviceId="configID" AppliesTo="Permit">
+                <AttributeAssignmentExpression AttributeId="type" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Configuration</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="URLID" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#anyURI">$URL/Config/com.Config_SampleBasePolicy.1.txt</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="PolicyName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">com.Config_SampleBasePolicy.1.xml</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="VersionNumber" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="matching:ONAPName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ONAP_TEST_123</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="matching:ConfigName" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleBasePolicy</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="RiskType" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SampleRiskType</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="RiskLevel" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">1</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="guard" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">False</AttributeValue>
+                </AttributeAssignmentExpression>
+                <AttributeAssignmentExpression AttributeId="TTLDate" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Issuer="">
+                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">17-01-2018</AttributeValue>
+                </AttributeAssignmentExpression>
+            </AdviceExpression>
+        </AdviceExpressions>
+    </Rule>
+</Policy>
diff --git a/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.pip.properties b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.pip.properties
new file mode 100644
index 0000000..bc4027a
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.pip.properties
@@ -0,0 +1,9 @@
+#
+#Wed Feb 14 16:26:32 EST 2018
+historydb.name=operationHistoryDB
+AAF.description=AAFEngine to communicate with AAF to take decisions
+historydb.issuer=org\:onap\:xacml\:guard\:historydb
+AAF.classname=org.onap.policy.xacml.std.pip.engines.aaf.AAFEngine
+AAF.name=AAFEngine
+historydb.classname=org.onap.policy.xacml.std.pip.engines.OperationHistoryEngine
+xacml.pip.engines=historydb,AAF
diff --git a/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.policy.properties b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.policy.properties
new file mode 100644
index 0000000..d2218a8
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/resources/pdps/testgroup2/xacml.policy.properties
@@ -0,0 +1,5 @@
+#
+#Wed Feb 14 16:26:32 EST 2018
+com.Config_SampleBasePolicy.1.xml.name=com.Config_SampleBasePolicy
+xacml.referencedPolicies=
+xacml.rootPolicies=com.Config_SampleBasePolicy.1.xml
diff --git a/ONAP-PAP-REST/src/test/resources/pdps/xacml.properties b/ONAP-PAP-REST/src/test/resources/pdps/xacml.properties
new file mode 100644
index 0000000..a6b85a0
--- /dev/null
+++ b/ONAP-PAP-REST/src/test/resources/pdps/xacml.properties
@@ -0,0 +1,10 @@
+#
+#Wed Feb 14 16:29:58 EST 2018
+default.description=this is my new description.
+default.name=newtestgroup2
+default.pdps=http\://localhost\:8082/pdp/
+http\://localhost\:8082/pdp/.description=Registered on first startup
+http\://localhost\:8082/pdp/.jmxport=
+http\://localhost\:8082/pdp/.name=http\://localhost\:8082/pdp/
+xacml.pap.groups=testgroup2
+xacml.pap.groups.default=testgroup2
