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 85d79f7..c9a2154 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
@@ -1421,12 +1421,10 @@
 			//If the selected policy is in the group we must remove the old version of it
 			LOGGER.info("Removing old version of the policy");
 			for(PDPPolicy existingPolicy : currentPoliciesInGroup) {
-				if (existingPolicy.getName().equals(policy.getName())){
-					if (!existingPolicy.getId().equals(policy.getId())) {
-						group.removePolicy(existingPolicy);
-						LOGGER.info("Removing policy: " + existingPolicy);
-						break;
-					}
+				if (existingPolicy.getName().equals(policy.getName()) && !existingPolicy.getId().equals(policy.getId())){
+					group.removePolicy(existingPolicy);
+					LOGGER.info("Removing policy: " + existingPolicy);
+					break;
 				}
 			}
 			
@@ -1620,12 +1618,10 @@
 					 */
 					if(apiflag != null){
 
-						// get the request content into a String
-						String json = null;
 						// read the inputStream into a buffer
 						java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
 						scanner.useDelimiter("\\A");
-						json =  scanner.hasNext() ? scanner.next() : "";
+						String json =  scanner.hasNext() ? scanner.next() : "";
 						scanner.close();
 						LOGGER.info("PushPolicy API request: " + json);
 						
@@ -1673,7 +1669,9 @@
 						}
 						
 						//delete temporary policy file from the bin directory
-						Files.deleteIfExists(Paths.get(policy.getId()));
+						if(policy != null) {
+							Files.deleteIfExists(Paths.get(policy.getId()));
+						}
 						
 					}
 				} catch (Exception e) {
@@ -2624,10 +2622,8 @@
 
 		public UpdatePDPThread(OnapPDP pdp, ONAPLoggingContext loggingContext) {
 			this.pdp = pdp;
-			if (!(loggingContext == null)) {
-				if (!(loggingContext.getRequestID() == null) || (loggingContext.getRequestID() == "")) {
+			if ((loggingContext != null) && (loggingContext.getRequestID() != null || loggingContext.getRequestID() == "")) {
 					this.requestId = loggingContext.getRequestID();
-				}
 			}
 			this.loggingContext = loggingContext;
 		}
@@ -2637,7 +2633,7 @@
 			HttpURLConnection connection = null;
 			// get a new logging context for the thread
 			try {
-				if (this.loggingContext.equals(null)) {
+				if (this.loggingContext == null) {
 				     loggingContext = new ONAPLoggingContext(baseLoggingContext);
 				} 
 			} catch (Exception e) {
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticData.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticData.java
index 3e065ff..b624f3b 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticData.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticData.java
@@ -113,7 +113,7 @@
 	private YAMLParams yamlparams; 
 
 	public PolicyElasticData(PolicyRestAdapter policyData) {
-		this.scope = policyData.getDomain();
+		this.scope = policyData.getDomainDir();
 		this.policyType = policyData.getPolicyType();
 		this.configPolicyType = policyData.getConfigPolicyType();
 		this.configBodyData = policyData.getConfigBodyData();
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java
index e7680c3..9be4b03 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java
@@ -130,7 +130,6 @@
 		policyAdapter.setDynamicSettingsMap(policy.getDynamicSettingsMap());
 		policyAdapter.setRuleProvider(policy.getProviderComboBox());
 		policyAdapter.setDomainDir(policyAdapter.getPolicyScope());
-		policyAdapter.setDomain(policyAdapter.getPolicyScope());
 		policyAdapter.setRainydayMap(policy.getTreatments());
 
 		return policyAdapter;
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 2af8a6e..76fe4ae 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
@@ -200,7 +200,7 @@
 					response.setStatus(HttpServletResponse.SC_NOT_FOUND);
 					response.addHeader("error", body);
 					response.addHeader("message", policyData.getPolicyName() + " does not exist on the PAP and cannot be updated.");
-					return new ResponseEntity<String>(body, status);
+					return new ResponseEntity<>(body, status);
 				}
 				version = 1;
 				if(userId == null){
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 b93cca3..55879ca 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
@@ -69,8 +69,7 @@
 		policyAdapter.setRuleCombiningAlgId("urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides");
 		policyAdapter.setPolicyType("Action");
 		policyAdapter.setEditPolicy(false);
-		policyAdapter.setDomainDir("src/test/resources/client.properties");
-		policyAdapter.setDomain("Test");
+		policyAdapter.setDomainDir("Test");
 		policyAdapter.setNewFileName("Test.Action_junitTest.1.xml");
 		policyAdapter.setHighestVersion(1);
 		policyAdapter.setPolicyID("urn:xacml:policy:id:"+UUID.randomUUID());
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 3854ab9..caa5707 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
@@ -72,8 +72,7 @@
 		policyAdapter.setRuleCombiningAlgId("urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides");
 		policyAdapter.setPolicyType("Decision");
 		policyAdapter.setEditPolicy(false);
-		policyAdapter.setDomainDir("src/test/resources/client.properties");
-		policyAdapter.setDomain("Test");
+		policyAdapter.setDomainDir("Test");
 		policyAdapter.setNewFileName("/src/test/resources/Test/client.properties");
 		policyAdapter.setHighestVersion(1);
 		policyAdapter.setPolicyID("urn:xacml:policy:id:"+UUID.randomUUID());
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicyTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicyTest.java
index 99285e7..a2c6ddf 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicyTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicyTest.java
@@ -63,8 +63,7 @@
 		policyAdapter.setPolicyType("Config");
 		policyAdapter.setConfigPolicyType("Firewall Config");
 		policyAdapter.setEditPolicy(false);
-		policyAdapter.setDomainDir("src/test/resources/client.properties");
-		policyAdapter.setDomain("Test");
+		policyAdapter.setDomainDir("Test");
 		policyAdapter.setNewFileName("Test.Config_FW_junitTest.1.xml");
 		policyAdapter.setHighestVersion(1);
 		policyAdapter.setVersion(String.valueOf(1));
diff --git a/ONAP-PAP-REST/src/test/resources/xacml.pap.properties b/ONAP-PAP-REST/src/test/resources/xacml.pap.properties
index f886435..c523d39 100644
--- a/ONAP-PAP-REST/src/test/resources/xacml.pap.properties
+++ b/ONAP-PAP-REST/src/test/resources/xacml.pap.properties
@@ -71,7 +71,7 @@
 #xacml.rest.pap.run.audit.flag=true
 #Turn the audit off to not synchronize the DB/file system
 #xacml.rest.pap.run.audit.flag=false
-xacml.rest.pap.run.audit.flag=true
+xacml.rest.pap.run.audit.flag=false
 
 #Audit will synchronize the file system to match the contents of the DB
 #xacml.rest.pap.filesystem.audit=true
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
index 483e13c..9939de9 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
@@ -244,17 +244,13 @@
     			return false;
     		}
     		
-    		if(policyParameters.getPolicyClass() != null){
-        		if ("Config".equals(policyParameters.getPolicyClass().toString())){
-        			String policyConfigType = policyParameters.getPolicyConfigType().toString();
-        			if(!"BRMS_Param".equalsIgnoreCase(policyConfigType)){
-            			if(Strings.isNullOrEmpty(policyParameters.getConfigBody())){
-            				message = XACMLErrorConstants.ERROR_DATA_ISSUE + "ConfigBody: No Config Body given";
-                    		LOGGER.error("Common validation did not return success:  " + message);
-                            return false;
-            			}
-        			}
-        		}
+    		if(policyParameters.getPolicyClass() != null && "Config".equals(policyParameters.getPolicyClass().toString())){
+    			String policyConfigType = policyParameters.getPolicyConfigType().toString();
+    			if(!"BRMS_Param".equalsIgnoreCase(policyConfigType) && Strings.isNullOrEmpty(policyParameters.getConfigBody())){
+    				message = XACMLErrorConstants.ERROR_DATA_ISSUE + "ConfigBody: No Config Body given";
+            		LOGGER.error("Common validation did not return success:  " + message);
+                    return false;
+    			}
     		}
 
     		try {
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/utils/PolicyApiUtils.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/utils/PolicyApiUtils.java
index 472d3aa..197db26 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/utils/PolicyApiUtils.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/utils/PolicyApiUtils.java
@@ -62,8 +62,7 @@
     public static String formatResponse(StringBuilder responseString){
     	
     	LOGGER.info("Formatting response message from Policy Validator");
-		String response = null;
-    	response = responseString.toString().replace("<br>", " | ");		
+    	String response = responseString.toString().replace("<br>", " | ");		
 		response = response.replaceAll("(<b>|<\\/b>|<br>|<i>|<\\/i>|@#)", "");
 				
     	return response;
@@ -126,8 +125,8 @@
         				|| "PUT".equals(json.getString("method").trim()) 
         				|| "POST".equals(json.getString("method").trim())){
         			
-        			message = SUCCESS;
-    				
+        			//Successful Validation
+        			
         		}else{
         			message = XACMLErrorConstants.ERROR_DATA_ISSUE + "Invalid Method value.";
     				return message;	
diff --git a/ONAP-REST/pom.xml b/ONAP-REST/pom.xml
index 3253081..499ec19 100644
--- a/ONAP-REST/pom.xml
+++ b/ONAP-REST/pom.xml
@@ -136,6 +136,11 @@
 		<!-- Spring -->
 		<dependency>
 			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+			<version>${springframework.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
 			<artifactId>spring-core</artifactId>
 			<version>${springframework.version}</version>
 		</dependency>
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopFaultBody.java b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopFaultBody.java
index 3d85f9f..73909d9 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopFaultBody.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopFaultBody.java
@@ -221,22 +221,6 @@
 		this.verificationSignatures = verificationSignatures;
 	}
 	
-	/*public ArrayList<String> getD2Services() {
-		return d2Services;
-	}
-
-	public void setD2Services(ArrayList<String> d2Services) {
-		this.d2Services = d2Services;
-	}
-
-	public ArrayList<String> getSiteNames() {
-		return siteNames;
-	}
-
-	public void setSiteNames(ArrayList<String> siteNames) {
-		this.siteNames = siteNames;
-	}*/
-	
 	public boolean isvDNS() {
 		return vDNS;
 	}
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
index 6de0c9b..de42468 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
@@ -342,12 +342,6 @@
 	public void setReadOnly(boolean readOnly) {
 		this.readOnly = readOnly;
 	}
-	public String getUserGitPath() {
-		return gitPath;
-	}
-	public void setUserGitPath(String gitPath) {
-		this.gitPath = gitPath;
-	}
 	public boolean isValidData() {
 		return isValidData;
 	}
@@ -629,281 +623,274 @@
 	public void setNewFileName(String newFileName) {
 		this.newFileName = newFileName;
 	}
-	
-	 public String getDomain() {
-			return domain;
-		}
-		public void setDomain(String domain) {
-			this.domain = domain;
-		}
-		public OnapName getOnapNameField() {
-			return onapNameField;
-		}
-		public void setOnapNameField(OnapName onapNameField) {
-			this.onapNameField = onapNameField;
-		}
-		public Object getJsonBodyData() {
-			return jsonBodyData;
-		}
-		public void setJsonBodyData(Object jsonBodyData) {
-			this.jsonBodyData = jsonBodyData;
-		}
-		public String getDirPath() {
-			return dirPath;
-		}
-		public void setDirPath(String dirPath) {
-			this.dirPath = dirPath;
-		}
-		public String getConfigBodyPath() {
-			return configBodyPath;
-		}
-		public void setConfigBodyPath(String configBodyPath) {
-			this.configBodyPath = configBodyPath;
-		}
-		public ArrayList<Object> getAttributes() {
-			return attributes;
-		}
-		public void setAttributes(ArrayList<Object> attributes) {
-			this.attributes = attributes;
-		}
-		public ArrayList<Object> getSettings() {
-			return settings;
-		}
-		public void setSettings(ArrayList<Object> settings) {
-			this.settings = settings;
-		}
-		public ArrayList<Object> getRuleAlgorithmschoices() {
-			return ruleAlgorithmschoices;
-		}
-		public void setRuleAlgorithmschoices(ArrayList<Object> ruleAlgorithmschoices) {
-			this.ruleAlgorithmschoices = ruleAlgorithmschoices;
-		}
-		public LinkedHashMap<?, ?> getServiceTypePolicyName() {
-			return serviceTypePolicyName;
-		}
-		public void setServiceTypePolicyName(LinkedHashMap<?, ?> serviceTypePolicyName) {
-			this.serviceTypePolicyName = serviceTypePolicyName;
-		}
-		public LinkedHashMap<?, ?> getVerticaMetrics() {
-			return verticaMetrics;
-		}
-		public void setVerticaMetrics(LinkedHashMap<?, ?> verticaMetrics) {
-			this.verticaMetrics = verticaMetrics;
-		}
-		public LinkedHashMap<?, ?> getDescription() {
-			return description;
-		}
-		public void setDescription(LinkedHashMap<?, ?> description) {
-			this.description = description;
-		}
-		public LinkedHashMap<?, ?> getAttributeFields() {
-			return attributeFields;
-		}
-		public void setAttributeFields(LinkedHashMap<?, ?> attributeFields) {
-			this.attributeFields = attributeFields;
-		}
-		public String getClearTimeOut() {
-			return clearTimeOut;
-		}
-		public void setClearTimeOut(String clearTimeOut) {
-			this.clearTimeOut = clearTimeOut;
-		}
-		public String getTrapMaxAge() {
-			return trapMaxAge;
-		}
-		public void setTrapMaxAge(String trapMaxAge) {
-			this.trapMaxAge = trapMaxAge;
-		}
-		public String getVerificationclearTimeOut() {
-			return verificationclearTimeOut;
-		}
-		public void setVerificationclearTimeOut(String verificationclearTimeOut) {
-			this.verificationclearTimeOut = verificationclearTimeOut;
-		}
-		public Map<String, String> getDynamicLayoutMap() {
-			return dynamicLayoutMap;
-		}
-		public void setDynamicLayoutMap(Map<String, String> dynamicLayoutMap) {
-			this.dynamicLayoutMap = dynamicLayoutMap;
-		}
-		public String getFwPolicyType() {
-			return fwPolicyType;
-		}
-		public void setFwPolicyType(String fwPolicyType) {
-			this.fwPolicyType = fwPolicyType;
-		}
-		public ArrayList<Object> getFwattributes() {
-			return fwattributes;
-		}
-		public void setFwattributes(ArrayList<Object> fwattributes) {
-			this.fwattributes = fwattributes;
-		}
-		public String getParentForChild() {
-			return parentForChild;
-		}
-		public void setParentForChild(String parentForChild) {
-			this.parentForChild = parentForChild;
-		}
-		public String getRuleName() {
-			return ruleName;
-		}
-		public void setRuleName(String ruleName) {
-			this.ruleName = ruleName;
-		}
-		public LinkedHashMap<?, ?> getRuleData() {
-			return ruleData;
-		}
-		public void setRuleData(LinkedHashMap<?, ?> ruleData) {
-			this.ruleData = ruleData;
-		}
-		public LinkedHashMap<?, ?> getRuleListData() {
-			return ruleListData;
-		}
-		public void setRuleListData(LinkedHashMap<?, ?> ruleListData) {
-			this.ruleListData = ruleListData;
-		}
-		public String getSecurityZone() {
-			return securityZone;
-		}
-		public void setSecurityZone(String securityZone) {
-			this.securityZone = securityZone;
-		}
-		public String getActionAttributeValue() {
-			return actionAttributeValue;
-		}
-		public void setActionAttributeValue(String actionAttributeValue) {
-			this.actionAttributeValue = actionAttributeValue;
-		}
-		public String getRuleProvider() {
-			return ruleProvider;
-		}
-		public void setRuleProvider(String ruleProvider) {
-			this.ruleProvider = ruleProvider;
-		}
-		public String getMsLocation() {
-			return msLocation;
-		}
-		public void setMsLocation(String msLocation) {
-			this.msLocation = msLocation;
-		}
-		public Map<String,String> getDrlRuleAndUIParams() {
-			return drlRuleAndUIParams;
-		}
-		public void setDrlRuleAndUIParams(Map<String,String> drlRuleAndUIParams) {
-			this.drlRuleAndUIParams = drlRuleAndUIParams;
-		}
-		public String getActionBody() {
-			return actionBody;
-		}
-		public void setActionBody(String actionBody) {
-			this.actionBody = actionBody;
-		}
-		public String getActionDictHeader() {
-			return actionDictHeader;
-		}
-		public void setActionDictHeader(String actionDictHeader) {
-			this.actionDictHeader = actionDictHeader;
-		}
-		public String getActionDictType() {
-			return actionDictType;
-		}
-		public void setActionDictType(String actionDictType) {
-			this.actionDictType = actionDictType;
-		}
-		public String getActionDictUrl() {
-			return actionDictUrl;
-		}
-		public void setActionDictUrl(String actionDictUrl) {
-			this.actionDictUrl = actionDictUrl;
-		}
-		public String getActionDictMethod() {
-			return actionDictMethod;
-		}
-		public void setActionDictMethod(String actionDictMethod) {
-			this.actionDictMethod = actionDictMethod;
-		}
-		public String getClWarning() {
-			return clWarning;
-		}
-		public void setClWarning(String clWarning) {
-			this.clWarning = clWarning;
-		}
-		public String getNewCLName() {
-			return newCLName;
-		}
-		public void setNewCLName(String newCLName) {
-			this.newCLName = newCLName;
-		}
-		public String getExistingCLName() {
-			return existingCLName;
-		}
-		public void setExistingCLName(String existingCLName) {
-			this.existingCLName = existingCLName;
-		}
-		public YAMLParams getYamlparams() {
-			return yamlparams;
-		}
-		public void setYamlparams(YAMLParams yamlparams) {
-			this.yamlparams = yamlparams;
-		}
-		/**
-		 * @return the rainyday
-		 */
-		public RainyDayParams getRainyday() {
-			return rainyday;
-		}
-		/**
-		 * @param rainyday the rainyday to set
-		 */
-		public void setRainyday(RainyDayParams rainyday) {
-			this.rainyday = rainyday;
-		}
-		/**
-		 * @return the errorCodeList
-		 */
-		public List<String> getErrorCodeList() {
-			return errorCodeList;
-		}
-		/**
-		 * @param errorCodeList the errorCodeList to set
-		 */
-		public void setErrorCodeList(List<String> errorCodeList) {
-			this.errorCodeList = errorCodeList;
-		}
-		/**
-		 * @return the treatmentList
-		 */
-		public List<String> getTreatmentList() {
-			return treatmentList;
-		}
-		/**
-		 * @param treatmentList the treatmentList to set
-		 */
-		public void setTreatmentList(List<String> treatmentList) {
-			this.treatmentList = treatmentList;
-		}
-		/**
-		 * @return the rainydayMap
-		 */
-		public Map<String,String> getRainydayMap() {
-			return rainydayMap;
-		}
-		/**
-		 * @param rainydayMap the rainydayMap to set
-		 */
-		public void setRainydayMap(Map<String,String> rainydayMap) {
-			this.rainydayMap = rainydayMap;
-		}
-		/**
-		 * @return the policyJSON
-		 */
-		public Object getPolicyJSON() {
-			return policyJSON;
-		}
-		/**
-		 * @param policyJSON the policyJSON to set
-		 */
-		public void setPolicyJSON(Object policyJSON) {
-			this.policyJSON = policyJSON;
-		}
+	public OnapName getOnapNameField() {
+		return onapNameField;
+	}
+	public void setOnapNameField(OnapName onapNameField) {
+		this.onapNameField = onapNameField;
+	}
+	public Object getJsonBodyData() {
+		return jsonBodyData;
+	}
+	public void setJsonBodyData(Object jsonBodyData) {
+		this.jsonBodyData = jsonBodyData;
+	}
+	public String getDirPath() {
+		return dirPath;
+	}
+	public void setDirPath(String dirPath) {
+		this.dirPath = dirPath;
+	}
+	public String getConfigBodyPath() {
+		return configBodyPath;
+	}
+	public void setConfigBodyPath(String configBodyPath) {
+		this.configBodyPath = configBodyPath;
+	}
+	public ArrayList<Object> getAttributes() {
+		return attributes;
+	}
+	public void setAttributes(ArrayList<Object> attributes) {
+		this.attributes = attributes;
+	}
+	public ArrayList<Object> getSettings() {
+		return settings;
+	}
+	public void setSettings(ArrayList<Object> settings) {
+		this.settings = settings;
+	}
+	public ArrayList<Object> getRuleAlgorithmschoices() {
+		return ruleAlgorithmschoices;
+	}
+	public void setRuleAlgorithmschoices(ArrayList<Object> ruleAlgorithmschoices) {
+		this.ruleAlgorithmschoices = ruleAlgorithmschoices;
+	}
+	public LinkedHashMap<?, ?> getServiceTypePolicyName() {
+		return serviceTypePolicyName;
+	}
+	public void setServiceTypePolicyName(LinkedHashMap<?, ?> serviceTypePolicyName) {
+		this.serviceTypePolicyName = serviceTypePolicyName;
+	}
+	public LinkedHashMap<?, ?> getVerticaMetrics() {
+		return verticaMetrics;
+	}
+	public void setVerticaMetrics(LinkedHashMap<?, ?> verticaMetrics) {
+		this.verticaMetrics = verticaMetrics;
+	}
+	public LinkedHashMap<?, ?> getDescription() {
+		return description;
+	}
+	public void setDescription(LinkedHashMap<?, ?> description) {
+		this.description = description;
+	}
+	public LinkedHashMap<?, ?> getAttributeFields() {
+		return attributeFields;
+	}
+	public void setAttributeFields(LinkedHashMap<?, ?> attributeFields) {
+		this.attributeFields = attributeFields;
+	}
+	public String getClearTimeOut() {
+		return clearTimeOut;
+	}
+	public void setClearTimeOut(String clearTimeOut) {
+		this.clearTimeOut = clearTimeOut;
+	}
+	public String getTrapMaxAge() {
+		return trapMaxAge;
+	}
+	public void setTrapMaxAge(String trapMaxAge) {
+		this.trapMaxAge = trapMaxAge;
+	}
+	public String getVerificationclearTimeOut() {
+		return verificationclearTimeOut;
+	}
+	public void setVerificationclearTimeOut(String verificationclearTimeOut) {
+		this.verificationclearTimeOut = verificationclearTimeOut;
+	}
+	public Map<String, String> getDynamicLayoutMap() {
+		return dynamicLayoutMap;
+	}
+	public void setDynamicLayoutMap(Map<String, String> dynamicLayoutMap) {
+		this.dynamicLayoutMap = dynamicLayoutMap;
+	}
+	public String getFwPolicyType() {
+		return fwPolicyType;
+	}
+	public void setFwPolicyType(String fwPolicyType) {
+		this.fwPolicyType = fwPolicyType;
+	}
+	public ArrayList<Object> getFwattributes() {
+		return fwattributes;
+	}
+	public void setFwattributes(ArrayList<Object> fwattributes) {
+		this.fwattributes = fwattributes;
+	}
+	public String getParentForChild() {
+		return parentForChild;
+	}
+	public void setParentForChild(String parentForChild) {
+		this.parentForChild = parentForChild;
+	}
+	public String getRuleName() {
+		return ruleName;
+	}
+	public void setRuleName(String ruleName) {
+		this.ruleName = ruleName;
+	}
+	public LinkedHashMap<?, ?> getRuleData() {
+		return ruleData;
+	}
+	public void setRuleData(LinkedHashMap<?, ?> ruleData) {
+		this.ruleData = ruleData;
+	}
+	public LinkedHashMap<?, ?> getRuleListData() {
+		return ruleListData;
+	}
+	public void setRuleListData(LinkedHashMap<?, ?> ruleListData) {
+		this.ruleListData = ruleListData;
+	}
+	public String getSecurityZone() {
+		return securityZone;
+	}
+	public void setSecurityZone(String securityZone) {
+		this.securityZone = securityZone;
+	}
+	public String getActionAttributeValue() {
+		return actionAttributeValue;
+	}
+	public void setActionAttributeValue(String actionAttributeValue) {
+		this.actionAttributeValue = actionAttributeValue;
+	}
+	public String getRuleProvider() {
+		return ruleProvider;
+	}
+	public void setRuleProvider(String ruleProvider) {
+		this.ruleProvider = ruleProvider;
+	}
+	public String getMsLocation() {
+		return msLocation;
+	}
+	public void setMsLocation(String msLocation) {
+		this.msLocation = msLocation;
+	}
+	public Map<String,String> getDrlRuleAndUIParams() {
+		return drlRuleAndUIParams;
+	}
+	public void setDrlRuleAndUIParams(Map<String,String> drlRuleAndUIParams) {
+		this.drlRuleAndUIParams = drlRuleAndUIParams;
+	}
+	public String getActionBody() {
+		return actionBody;
+	}
+	public void setActionBody(String actionBody) {
+		this.actionBody = actionBody;
+	}
+	public String getActionDictHeader() {
+		return actionDictHeader;
+	}
+	public void setActionDictHeader(String actionDictHeader) {
+		this.actionDictHeader = actionDictHeader;
+	}
+	public String getActionDictType() {
+		return actionDictType;
+	}
+	public void setActionDictType(String actionDictType) {
+		this.actionDictType = actionDictType;
+	}
+	public String getActionDictUrl() {
+		return actionDictUrl;
+	}
+	public void setActionDictUrl(String actionDictUrl) {
+		this.actionDictUrl = actionDictUrl;
+	}
+	public String getActionDictMethod() {
+		return actionDictMethod;
+	}
+	public void setActionDictMethod(String actionDictMethod) {
+		this.actionDictMethod = actionDictMethod;
+	}
+	public String getClWarning() {
+		return clWarning;
+	}
+	public void setClWarning(String clWarning) {
+		this.clWarning = clWarning;
+	}
+	public String getNewCLName() {
+		return newCLName;
+	}
+	public void setNewCLName(String newCLName) {
+		this.newCLName = newCLName;
+	}
+	public String getExistingCLName() {
+		return existingCLName;
+	}
+	public void setExistingCLName(String existingCLName) {
+		this.existingCLName = existingCLName;
+	}
+	public YAMLParams getYamlparams() {
+		return yamlparams;
+	}
+	public void setYamlparams(YAMLParams yamlparams) {
+		this.yamlparams = yamlparams;
+	}
+	/**
+	 * @return the rainyday
+	 */
+	public RainyDayParams getRainyday() {
+		return rainyday;
+	}
+	/**
+	 * @param rainyday the rainyday to set
+	 */
+	public void setRainyday(RainyDayParams rainyday) {
+		this.rainyday = rainyday;
+	}
+	/**
+	 * @return the errorCodeList
+	 */
+	public List<String> getErrorCodeList() {
+		return errorCodeList;
+	}
+	/**
+	 * @param errorCodeList the errorCodeList to set
+	 */
+	public void setErrorCodeList(List<String> errorCodeList) {
+		this.errorCodeList = errorCodeList;
+	}
+	/**
+	 * @return the treatmentList
+	 */
+	public List<String> getTreatmentList() {
+		return treatmentList;
+	}
+	/**
+	 * @param treatmentList the treatmentList to set
+	 */
+	public void setTreatmentList(List<String> treatmentList) {
+		this.treatmentList = treatmentList;
+	}
+	/**
+	 * @return the rainydayMap
+	 */
+	public Map<String,String> getRainydayMap() {
+		return rainydayMap;
+	}
+	/**
+	 * @param rainydayMap the rainydayMap to set
+	 */
+	public void setRainydayMap(Map<String,String> rainydayMap) {
+		this.rainydayMap = rainydayMap;
+	}
+	/**
+	 * @return the policyJSON
+	 */
+	public Object getPolicyJSON() {
+		return policyJSON;
+	}
+	/**
+	 * @param policyJSON the policyJSON to set
+	 */
+	public void setPolicyJSON(Object policyJSON) {
+		this.policyJSON = policyJSON;
+	}
 }
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImpl.java b/ONAP-REST/src/main/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImpl.java
index f6682eb..8aa0435 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImpl.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImpl.java
@@ -20,6 +20,7 @@
 package org.onap.policy.rest.daoimpl;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -42,12 +43,13 @@
 import org.onap.policy.xacml.api.XACMLErrorConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
 
 @Component
 public class PolicyValidationDaoImpl implements CommonClassDao{
 
 	private static final Logger LOGGER = FlexLogger.getLogger(PolicyValidationDaoImpl.class);
+	private static final String DB_CONNECTION_CLOSING_ERROR = "Error While Closing Connection/Statement";
+	private static final String DBTABLE_QUERY_ERROR = "Error While Querying Table";
 	private static SessionFactory sessionfactory;
     
     public static SessionFactory getSessionfactory() {
@@ -76,12 +78,12 @@
 			Criteria cr = session.createCriteria(className);
 			data = cr.list();
 		}catch(Exception e){
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Table"+e);	
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR+e);
 			}
 		}
 		return data;
@@ -106,12 +108,12 @@
 			}
 			data = cr.list();
 		} catch (Exception e) {
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Table"+e);		
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return data;
@@ -125,12 +127,12 @@
 			session.persist(entity);
 			tx.commit();	
 		}catch(Exception e){
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving  data to Table"+e);	
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving data to Table"+e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		
@@ -149,7 +151,7 @@
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		
@@ -169,7 +171,7 @@
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		
@@ -207,7 +209,7 @@
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return data;
@@ -240,7 +242,7 @@
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return rolesData;
@@ -249,12 +251,14 @@
 
 	@Override
 	public List<Object> checkExistingGroupListforUpdate(String arg0, String arg1) {
-		return null;
+		return Collections.emptyList();
 	}
 
 
 	@Override
-	public void deleteAll() {}
+	public void deleteAll() {
+		// Do nothing because this method is not used and is a placeholder to avoid 'Unimplemented Method' error
+	}
 
 	
 	@SuppressWarnings("unchecked")
@@ -276,13 +280,13 @@
 			data = hbquery.list();
 			tx.commit();
 		} catch (Exception e) {
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Database Table"+e);
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + e);	
 			throw e;
 		}finally{
 			try{
 				session.close();
 			}catch(HibernateException e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return data;
@@ -309,12 +313,12 @@
 			data = cr.list().get(0);
 			tx.commit();
 		} catch (Exception e) {
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Database Table"+e);	
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return data;
@@ -322,11 +326,15 @@
 
 
 	@Override
-	public void updateClAlarms(String arg0, String arg1) {}
+	public void updateClAlarms(String arg0, String arg1) {
+		// Do nothing because this method is not used and is a placeholder to avoid 'Unimplemented Method' error
+	}
 
 
 	@Override
-	public void updateClYaml(String arg0, String arg1) {}
+	public void updateClYaml(String arg0, String arg1) {
+		// Do nothing because this method is not used and is a placeholder to avoid 'Unimplemented Method' error
+	}
 
 
 	@Override
@@ -343,7 +351,7 @@
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		
@@ -360,12 +368,12 @@
 			cr.setProjection(Projections.property(columnName));
 			data = cr.list();
 		}catch(Exception e){
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Table"+e);	
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e);
 			}
 		}
 		return data;
@@ -396,12 +404,12 @@
 			entityData = cr.add(disjunction).list();
 			tx.commit();
 		} catch (Exception e) {
-			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Table" +className +e);	
+			LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DBTABLE_QUERY_ERROR + className + e);	
 		}finally{
 			try{
 				session.close();
 			}catch(Exception e1){
-				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
+				LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + DB_CONNECTION_CLOSING_ERROR + e1);
 			}
 		}
 		return entityData;
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
index 223381a..e98a41f 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
@@ -60,6 +60,9 @@
 	public static final String ENFORCER_CONFIG_POLICY= "Enforcer Config";
 	public static final String MICROSERVICES="Micro Service";
 	public static final String FIREWALL="Firewall Config";
+	public static final String HTML_ITALICS_LNBREAK = "</i><br>";
+	public static final String SUCCESS = "success";
+	public static final String EMPTY_COMPONENT_ATTR = "Component Attributes: One or more Fields in Component Attributes is Empty.";
 	
 	private static Map<String, String> mapAttribute = new HashMap<>();
 	
@@ -84,7 +87,7 @@
 			
 			if(policyData.getPolicyName() != null){
 				String policyNameValidate = PolicyUtils.policySpecialCharValidator(policyData.getPolicyName());
-				if(!policyNameValidate.contains("success")){
+				if(!policyNameValidate.contains(SUCCESS)){
 					responseString.append("PolicyName:" +  policyNameValidate + "<br>");
 					valid = false;
 				};
@@ -94,7 +97,7 @@
 			}
 			if(policyData.getPolicyDescription() != null){
 				String descriptionValidate = PolicyUtils.descriptionValidator(policyData.getPolicyDescription());
-				if(!descriptionValidate.contains("success")){
+				if(!descriptionValidate.contains(SUCCESS)){
 					responseString.append("Description:" +  descriptionValidate + "<br>");
 					valid = false;
 				}	
@@ -107,7 +110,7 @@
 					
 					if(!Strings.isNullOrEmpty(policyData.getOnapName())) {
 						String onapNameValidate = PolicyUtils.policySpecialCharValidator(policyData.getOnapName());
-						if(!onapNameValidate.contains("success")){
+						if(!onapNameValidate.contains(SUCCESS)){
 							responseString.append("OnapName:" +  onapNameValidate + "<br>");
 							valid = false;
 						}
@@ -119,7 +122,7 @@
 
 				if(!Strings.isNullOrEmpty(policyData.getRiskType())) {
 					String riskTypeValidate = PolicyUtils.policySpecialCharValidator(policyData.getRiskType());
-					if(!riskTypeValidate.contains("success")){
+					if(!riskTypeValidate.contains(SUCCESS)){
 						responseString.append("RiskType:" +  riskTypeValidate + "<br>");
 						valid = false;
 					}
@@ -130,7 +133,7 @@
 
 				if(!Strings.isNullOrEmpty(policyData.getRiskLevel())) {
 					String validateRiskLevel = PolicyUtils.policySpecialCharValidator(policyData.getRiskLevel());
-					if(!validateRiskLevel.contains("success")){
+					if(!validateRiskLevel.contains(SUCCESS)){
 						responseString.append("RiskLevel:" +  validateRiskLevel + "<br>");
 						valid = false;
 					}
@@ -141,7 +144,7 @@
 
 				if(!Strings.isNullOrEmpty(policyData.getGuard())) {
 					String validateGuard = PolicyUtils.policySpecialCharValidator(policyData.getGuard());
-					if(!validateGuard.contains("success")){
+					if(!validateGuard.contains(SUCCESS)){
 						responseString.append("Guard:" +  validateGuard + "<br>");
 						valid = false;
 					}
@@ -153,7 +156,7 @@
 				if("Base".equalsIgnoreCase(policyData.getConfigPolicyType())){
 					if(!Strings.isNullOrEmpty(policyData.getConfigName())) {
 						String configNameValidate = PolicyUtils.policySpecialCharValidator(policyData.getConfigName());
-						if(!configNameValidate.contains("success")){
+						if(!configNameValidate.contains(SUCCESS)){
 							responseString.append("ConfigName:" +  configNameValidate + "<br>");
 							valid = false;
 						}
@@ -163,7 +166,7 @@
 					}
 					if(!Strings.isNullOrEmpty(policyData.getConfigType())) {
 						String configTypeValidate = PolicyUtils.policySpecialCharValidator(policyData.getConfigType());
-						if(!configTypeValidate.contains("success")){
+						if(!configTypeValidate.contains(SUCCESS)){
 							responseString.append("ConfigType:" +  configTypeValidate + "<br>");
 							valid = false;
 						}
@@ -190,11 +193,9 @@
 									responseString.append("Config Body: Property data is not valid" + "<br>");
 									valid = false;
 								} 
-							} else if (configType.equals("OTHER")) {
-								if (configBodyData.equals("")) {
-									responseString.append("Config Body: Config Body Should not be Empty" + "<br>");
-									valid = false;
-								}
+							} else if ("OTHER".equals(configType) && ("".equals(configBodyData))) {
+								responseString.append("Config Body: Config Body Should not be Empty" + "<br>");
+								valid = false;
 							}
 						}
 					}else{
@@ -203,27 +204,25 @@
 					}
 				}
 
-				if("Firewall Config".equalsIgnoreCase(policyData.getConfigPolicyType())){
+				if(FIREWALL.equalsIgnoreCase(policyData.getConfigPolicyType())){
 					if(policyData.getConfigName() != null && !policyData.getConfigName().isEmpty()){
 						String configNameValidate = PolicyUtils.policySpecialCharValidator(policyData.getConfigName());
-						if(!configNameValidate.contains("success")){
-							responseString.append("<b>ConfigName</b>:<i>" +  configNameValidate + "</i><br>");
+						if(!configNameValidate.contains(SUCCESS)){
+							responseString.append("<b>ConfigName</b>:<i>" +  configNameValidate + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 					}else{
-						responseString.append("<b>Config Name</b>:<i> Config Name is required" + "</i><br>");
+						responseString.append("<b>Config Name</b>:<i> Config Name is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 					if(policyData.getSecurityZone() == null || policyData.getSecurityZone().isEmpty()){
-						responseString.append("<b>Security Zone</b>:<i> Security Zone is required" + "</i><br>");
+						responseString.append("<b>Security Zone</b>:<i> Security Zone is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 				}
-				if("BRMS_Param".equalsIgnoreCase(policyData.getConfigPolicyType())){
-					if(policyData.getRuleName() == null || policyData.getRuleName().isEmpty()){
-						responseString.append("<b>BRMS Template</b>:<i>BRMS Template is required</i><br>");
-						valid = false;
-					}
+				if("BRMS_Param".equalsIgnoreCase(policyData.getConfigPolicyType()) && Strings.isNullOrEmpty(policyData.getRuleName())){
+					responseString.append("<b>BRMS Template</b>:<i>BRMS Template is required" + HTML_ITALICS_LNBREAK);
+					valid = false;
 				}
 				if("BRMS_Raw".equalsIgnoreCase(policyData.getConfigPolicyType())){
 					if(policyData.getConfigBodyData() != null && !policyData.getConfigBodyData().isEmpty()){
@@ -231,44 +230,45 @@
 						
 						// If there are any error other than Annotations then this is not Valid
 						if(message.contains("[ERR")){
-							responseString.append("<b>Raw Rule Validate</b>:<i>Raw Rule has error"+ message +"</i><br>");
+							responseString.append("<b>Raw Rule Validate</b>:<i>Raw Rule has error"+ message + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 					}else{
-						responseString.append("<b>Raw Rule</b>:<i>Raw Rule is required</i><br>");
+						responseString.append("<b>Raw Rule</b>:<i>Raw Rule is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 				}
-				if("ClosedLoop_PM".equalsIgnoreCase(policyData.getConfigPolicyType())){
+				if(CLOSEDLOOP_PM.equalsIgnoreCase(policyData.getConfigPolicyType())){
 					try{
 						if(Strings.isNullOrEmpty(policyData.getServiceTypePolicyName().get("serviceTypePolicyName").toString())){
-							responseString.append("<b>ServiceType PolicyName</b>:<i>ServiceType PolicyName is required</i><br>");
+							responseString.append("<b>ServiceType PolicyName</b>:<i>ServiceType PolicyName is required" + HTML_ITALICS_LNBREAK);
 							valid = false; 
 						}
 						
 					}catch(Exception e){
 					    LOGGER.error("ERROR in ClosedLoop_PM PolicyName" , e);
-						responseString.append("<b>ServiceType PolicyName</b>:<i>ServiceType PolicyName is required</i><br>");
+						responseString.append("<b>ServiceType PolicyName</b>:<i>ServiceType PolicyName is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 
 					if(policyData.getJsonBody() != null){
-						ClosedLoopPMBody pmBody = (ClosedLoopPMBody)mapper.readValue(policyData.getJsonBody(), ClosedLoopPMBody.class);
+						
+						ClosedLoopPMBody pmBody = mapper.readValue(policyData.getJsonBody(), ClosedLoopPMBody.class);
 						if(pmBody.getEmailAddress() != null){
 							String result = emailValidation(pmBody.getEmailAddress(), responseString.toString());
-							if(result != "success"){
+							if(result != SUCCESS){
 								responseString.append(result + "<br>");
 								valid = false;
 							}
 						}
 						if((pmBody.isGamma() || pmBody.isMcr() || pmBody.isTrinity() || pmBody.isvDNS() || pmBody.isvUSP()) != true){
-							responseString.append("<b>D2/Virtualized Services</b>: <i>Select at least one D2/Virtualized Services</i><br>");
+							responseString.append("<b>D2/Virtualized Services</b>: <i>Select at least one D2/Virtualized Services" + HTML_ITALICS_LNBREAK);
 							valid = false; 
 						}
 						if(pmBody.getGeoLink() != null && !pmBody.getGeoLink().isEmpty()){
 							String result = PolicyUtils.policySpecialCharValidator(pmBody.getGeoLink());
-							if(!result.contains("success")){
-								responseString.append("<b>GeoLink</b>:<i>" +  result + "</i><br>");
+							if(!result.contains(SUCCESS)){
+								responseString.append("<b>GeoLink</b>:<i>" +  result + HTML_ITALICS_LNBREAK);
 								valid = false;
 							};
 						}
@@ -278,19 +278,19 @@
 								String value = entry.getValue();
 								if(!key.contains("Message")){
 									String attributeValidate = PolicyUtils.policySpecialCharValidator(value);
-									if(!attributeValidate.contains("success")){
-										responseString.append("<b>Attributes</b>:<i>" +  key + " : value has spaces or invalid characters</i><br>");
+									if(!attributeValidate.contains(SUCCESS)){
+										responseString.append("<b>Attributes</b>:<i>" +  key + " : value has spaces or invalid characters" + HTML_ITALICS_LNBREAK);
 										valid = false;
 									};
 								}
 							}	
 						}
 					}else{
-						responseString.append("<b>D2/Virtualized Services</b>:<i>Select atleast one D2/Virtualized Services</i><br>");
+						responseString.append("<b>D2/Virtualized Services</b>:<i>Select atleast one D2/Virtualized Services" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 				}
-				if("ClosedLoop_Fault".equalsIgnoreCase(policyData.getConfigPolicyType())){
+				if(CLOSEDLOOP_POLICY.equalsIgnoreCase(policyData.getConfigPolicyType())){
 					if(policyData.getJsonBody() != null){
 
 						// For API we need to get the conditions key from the Json request and check it before deserializing to POJO due to the enum
@@ -299,11 +299,11 @@
 							if(!json.isNull("conditions")){
 								String apiCondition = (String) json.get("conditions");
 								if(Strings.isNullOrEmpty(apiCondition)){
-									responseString.append("<b>Conditions</b>: <i>Select At least one Condition</i><br>");
+									responseString.append("<b>Conditions</b>: <i>Select At least one Condition" + HTML_ITALICS_LNBREAK);
 									return responseString;
 								}
 							} else {
-								responseString.append("<b>Conditions</b>: <i>There were no conditions provided in configBody json</i><br>");
+								responseString.append("<b>Conditions</b>: <i>There were no conditions provided in configBody json" + HTML_ITALICS_LNBREAK);
 								return responseString;
 							}
 						}
@@ -311,79 +311,79 @@
 						ClosedLoopFaultBody faultBody = mapper.readValue(policyData.getJsonBody(), ClosedLoopFaultBody.class);
 						if(faultBody.getEmailAddress() != null && !faultBody.getEmailAddress().isEmpty()){
 							String result = emailValidation(faultBody.getEmailAddress(), responseString.toString());
-							if(result != "success"){
+							if(result != SUCCESS){
 								responseString.append(result+ "<br>");
 								valid = false;
 							}
 						}
 						if((faultBody.isGamma() || faultBody.isMcr() || faultBody.isTrinity() || faultBody.isvDNS() || faultBody.isvUSP()) != true){
-							responseString.append("<b>D2/Virtualized Services</b>: <i>Select at least one D2/Virtualized Services</i><br>");
+							responseString.append("<b>D2/Virtualized Services</b>: <i>Select at least one D2/Virtualized Services" + HTML_ITALICS_LNBREAK);
 							valid = false; 
 						}
 						if(faultBody.getActions() == null || faultBody.getActions().isEmpty()){
-							responseString.append("<b>vPRO Actions</b>: <i>vPRO Actions is required</i><br>");
+							responseString.append("<b>vPRO Actions</b>: <i>vPRO Actions is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getClosedLoopPolicyStatus() == null || faultBody.getClosedLoopPolicyStatus().isEmpty()){
-							responseString.append("<b>Policy Status</b>: <i>Policy Status is required</i><br>");
+							responseString.append("<b>Policy Status</b>: <i>Policy Status is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getConditions() == null){
-							responseString.append("<b>Conditions</b>: <i>Select At least one Condition</i><br>");
+							responseString.append("<b>Conditions</b>: <i>Select At least one Condition" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getGeoLink() != null && !faultBody.getGeoLink().isEmpty()){
 							String result = PolicyUtils.policySpecialCharWithSpaceValidator(faultBody.getGeoLink());
-							if(!result.contains("success")){
-								responseString.append("<b>GeoLink</b>:<i>" +  result + "</i><br>");
+							if(!result.contains(SUCCESS)){
+								responseString.append("<b>GeoLink</b>:<i>" +  result + HTML_ITALICS_LNBREAK);
 								valid = false;
 							}
 						}
 						if(faultBody.getAgingWindow() == 0){
-							responseString.append("<b>Aging Window</b>: <i>Aging Window is required</i><br>");
+							responseString.append("<b>Aging Window</b>: <i>Aging Window is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getTimeInterval() == 0){
-							responseString.append("<b>Time Interval</b>: <i>Time Interval is required</i><br>");
+							responseString.append("<b>Time Interval</b>: <i>Time Interval is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getRetrys() == 0){
-							responseString.append("<b>Number of Retries</b>: <i>Number of Retries is required</i><br>");
+							responseString.append("<b>Number of Retries</b>: <i>Number of Retries is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getTimeOutvPRO() == 0){
-							responseString.append("<b>APP-C Timeout</b>: <i>APP-C Timeout is required</i><br>");
+							responseString.append("<b>APP-C Timeout</b>: <i>APP-C Timeout is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getTimeOutRuby() == 0){
-							responseString.append("<b>TimeOutRuby</b>: <i>TimeOutRuby is required</i><br>");
+							responseString.append("<b>TimeOutRuby</b>: <i>TimeOutRuby is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 						if(faultBody.getVnfType() == null || faultBody.getVnfType().isEmpty()){
-							responseString.append("<b>Vnf Type</b>: <i>Vnf Type is required</i><br>");
+							responseString.append("<b>Vnf Type</b>: <i>Vnf Type is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 					}else{
-						responseString.append("<b>D2/Virtualized Services</b>: <i>Select atleast one D2/Virtualized Services</i><br>");
-						responseString.append("<b>vPRO Actions</b>: <i>vPRO Actions is required</i><br>");
-						responseString.append("<b>Aging Window</b>: <i>Aging Window is required</i><br>");
-						responseString.append("<b>Policy Status</b>: <i>Policy Status is required</i><br>");
-						responseString.append("<b>Conditions</b>: <i>Select Atleast one Condition</i><br>");
-						responseString.append("<b>PEP Name</b>: <i>PEP Name is required</i><br>");
-						responseString.append("<b>PEP Action</b>: <i>PEP Action is required</i><br>");
-						responseString.append("<b>Time Interval</b>: <i>Time Interval is required</i><br>");
-						responseString.append("<b>Number of Retries</b>: <i>Number of Retries is required</i><br>");
-						responseString.append("<b>APP-C Timeout</b>: <i>APP-C Timeout is required</i><br>");
-						responseString.append("<b>TimeOutRuby</b>: <i>TimeOutRuby is required</i><br>");
-						responseString.append("<b>Vnf Type</b>: <i>Vnf Type is required</i><br>");
+						responseString.append("<b>D2/Virtualized Services</b>: <i>Select atleast one D2/Virtualized Services" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>vPRO Actions</b>: <i>vPRO Actions is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Aging Window</b>: <i>Aging Window is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Policy Status</b>: <i>Policy Status is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Conditions</b>: <i>Select Atleast one Condition" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>PEP Name</b>: <i>PEP Name is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>PEP Action</b>: <i>PEP Action is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Time Interval</b>: <i>Time Interval is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Number of Retries</b>: <i>Number of Retries is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>APP-C Timeout</b>: <i>APP-C Timeout is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>TimeOutRuby</b>: <i>TimeOutRuby is required" + HTML_ITALICS_LNBREAK);
+						responseString.append("<b>Vnf Type</b>: <i>Vnf Type is required" + HTML_ITALICS_LNBREAK);
 						valid = false; 
 					}
 				}
 
-				if ("Micro Service".equals(policyData.getConfigPolicyType())){
+				if (MICROSERVICES.equals(policyData.getConfigPolicyType())){
 					if(!Strings.isNullOrEmpty(policyData.getServiceType())){
 						pullJsonKeyPairs((JsonNode) policyData.getPolicyJSON());
-						MicroServiceModels returnModel = new MicroServiceModels();
+
 						String service = null;
 						String version = null;
 						if (policyData.getServiceType().contains("-v")){
@@ -395,13 +395,12 @@
 						}
 						
 						if(!Strings.isNullOrEmpty(version)) {
-							returnModel = getAttributeObject(service, version);
+							MicroServiceModels returnModel = getAttributeObject(service, version);
 							
 							if(returnModel != null) {
 								String annotation = returnModel.getAnnotation();
 								if (!Strings.isNullOrEmpty(annotation)){ 
-									Map<String, String> rangeMap = new HashMap<>();
-									rangeMap = Splitter.on(",").withKeyValueSeparator("=").split(annotation);
+									Map<String, String> rangeMap = Splitter.on(",").withKeyValueSeparator("=").split(annotation);
 									for (Entry<String, String> rMap : rangeMap.entrySet()){
 										if (rMap.getValue().contains("range::")){
 											String value = mapAttribute.get(rMap.getKey().trim());
@@ -424,7 +423,7 @@
 												}
 											} else {
 												responseString.append("<b>"+rMap.getKey()+"</b>:<i>" + rMap.getKey() 
-												+ " is required for the MicroService model " + service + "</i><br>");
+												+ " is required for the MicroService model " + service + HTML_ITALICS_LNBREAK);
 												valid = false;
 											}
 
@@ -433,20 +432,20 @@
 								}
 							} else {
 								responseString.append("<b>Micro Service Model</b>:<i> Invalid Model. The model name, " + service + 
-										" of version, " + version + " was not found in the dictionary</i><br>");
+										" of version, " + version + " was not found in the dictionary" + HTML_ITALICS_LNBREAK);
 								valid = false;
 							}
 						} else {
-							responseString.append("<b>Micro Version</b>:<i> Micro Service Version is required" + "</i><br>");
+							responseString.append("<b>Micro Version</b>:<i> Micro Service Version is required" + HTML_ITALICS_LNBREAK);
 							valid = false;
 						}
 					} else {
-						responseString.append("<b>Micro Service</b>:<i> Micro Service is required" + "</i><br>");
+						responseString.append("<b>Micro Service</b>:<i> Micro Service is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 
 					if(Strings.isNullOrEmpty(policyData.getPriority())){
-						responseString.append("<b>Priority</b>:<i> Priority is required" + "</i><br>");
+						responseString.append("<b>Priority</b>:<i> Priority is required" + HTML_ITALICS_LNBREAK);
 						valid = false;
 					}
 				}	
@@ -454,7 +453,7 @@
 			if (DECISION_POLICY.equalsIgnoreCase(policyData.getPolicyType())){
 				if(!Strings.isNullOrEmpty(policyData.getOnapName())){
 					String onapNameValidate = PolicyUtils.policySpecialCharValidator(policyData.getOnapName());
-					if(!onapNameValidate.contains("success")){
+					if(!onapNameValidate.contains(SUCCESS)){
 						responseString.append("OnapName:" +  onapNameValidate + "<br>");
 						valid = false;
 					}
@@ -570,7 +569,7 @@
 								valid = false;
 							}else{
 								for(String blackList: policyData.getYamlparams().getBlackList()){
-									if(blackList==null || !("success".equals(PolicyUtils.policySpecialCharValidator(blackList)))){
+									if(blackList==null || !(SUCCESS.equals(PolicyUtils.policySpecialCharValidator(blackList)))){
 										responseString.append(" Guard Params <b>BlackList</b> Should be valid String" + "<br>");
 										valid = false;
 										break;
@@ -585,7 +584,7 @@
 			if(ACTION_POLICY.equalsIgnoreCase(policyData.getPolicyType())){
 				if(!Strings.isNullOrEmpty(policyData.getActionPerformer())){
 					String actionPerformer = PolicyUtils.policySpecialCharValidator(policyData.getActionPerformer());
-					if(!actionPerformer.contains("success")){
+					if(!actionPerformer.contains(SUCCESS)){
 						responseString.append("ActionPerformer:" +  actionPerformer + "<br>");
 						valid = false;
 					}
@@ -601,25 +600,25 @@
 								String key = ((LinkedHashMap<?, ?>) attribute).get("key").toString();
 								String value =  ((LinkedHashMap<?, ?>) attribute).get("value").toString();
 								if("".equals(key) || "".equals(value)){
-									responseString.append("Component Attributes: One or more Fields in Component Attributes is Empty." + "<br>");
+									responseString.append(EMPTY_COMPONENT_ATTR + "<br>");
 									valid = false;
 									break;	
 								}
 							}catch(Exception e){
 								LOGGER.error("This is a Policy Validation check" +e);
-								responseString.append("Component Attributes: One or more Fields in Component Attributes is Empty." + "<br>");
+								responseString.append(EMPTY_COMPONENT_ATTR + "<br>");
 								valid = false;
 								break;
 							}
 						}
 					}
 				}else{
-					responseString.append("Component Attributes: One or more Fields in Component Attributes is Empty." + "<br>");
+					responseString.append(EMPTY_COMPONENT_ATTR + "<br>");
 					valid = false;
 				}
 				if(!Strings.isNullOrEmpty(policyData.getActionAttributeValue())){
 					String actionAttribute = PolicyUtils.policySpecialCharValidator(policyData.getActionAttributeValue());
-					if(!actionAttribute.contains("success")){
+					if(!actionAttribute.contains(SUCCESS)){
 						responseString.append("ActionAttribute:" +  actionAttribute + "<br>");
 						valid = false;
 					};
@@ -662,11 +661,11 @@
 							value = "Message:" +  safePolicyWarningData.getMessage();
 						}
 					}
-					responseString.append("success" + "@#"+ value);
+					responseString.append(SUCCESS + "@#"+ value);
 				}
 			}else{
 				if(valid){
-					responseString.append("success");
+					responseString.append(SUCCESS);
 				}
 			}
 
@@ -681,10 +680,10 @@
 	protected String emailValidation(String email, String response){
 		if(email != null){
 			String validateEmail = PolicyUtils.validateEmailAddress(email.replace("\"", ""));
-			if(!validateEmail.contains("success")){
-				response += "<b>Email</b>:<i>" +  validateEmail+ "</i><br>";
+			if(!validateEmail.contains(SUCCESS)){
+				response += "<b>Email</b>:<i>" +  validateEmail + HTML_ITALICS_LNBREAK;
 			}else{
-				return "success";
+				return SUCCESS;
 			}
 		}
 		return response;
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidationRequestWrapper.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidationRequestWrapper.java
index 0724622..03c1fb0 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidationRequestWrapper.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidationRequestWrapper.java
@@ -63,16 +63,14 @@
 			policyData = mapper.readValue(root.get("policyData").toString(), PolicyRestAdapter.class);
 			
 			JsonObject json = null;
-			if(root != null){
-				json = stringToJsonObject(root.toString());
-				
-				if(json != null){
-					if(json.containsKey("policyJSON")){
-						policyData.setPolicyJSON(root.get("policyJSON"));
-					}else{
-						String jsonBodyData = json.getJsonObject("policyData").get("jsonBodyData").toString();
-						policyData.setJsonBody(jsonBodyData);
-					}
+			json = stringToJsonObject(root.toString());
+			
+			if(json != null){
+				if(json.containsKey("policyJSON")){
+					policyData.setPolicyJSON(root.get("policyJSON"));
+				}else{
+					String jsonBodyData = json.getJsonObject("policyData").get("jsonBodyData").toString();
+					policyData.setJsonBody(jsonBodyData);
 				}
 			}			
 						
@@ -127,13 +125,13 @@
 					// Set Matching attributes in RainyDayParams in adapter
 					RainyDayParams rainyday = new RainyDayParams();
 					
-					rainyday.setServiceType(matching.get("ServiceType"));
-					rainyday.setVnfType(matching.get("VNFType"));
-					rainyday.setBbid(matching.get("BB_ID"));
-					rainyday.setWorkstep(matching.get("WorkStep"));
-					
-					
-					
+					if(matching != null) {
+						rainyday.setServiceType(matching.get("ServiceType"));
+						rainyday.setVnfType(matching.get("VNFType"));
+						rainyday.setBbid(matching.get("BB_ID"));
+						rainyday.setWorkstep(matching.get("WorkStep"));
+					}
+
 					Map<String, String> treatments = parameters.getTreatments();
 					ArrayList<Object> treatmentsTableChoices = new ArrayList<>();
 					
@@ -153,32 +151,32 @@
 					// Set Matching attributes in YAMLParams in adapter
 					YAMLParams yamlparams = new YAMLParams();
 					
-					yamlparams.setActor(matching.get("actor"));
-					yamlparams.setRecipe(matching.get("recipe"));
-					yamlparams.setGuardActiveStart(matching.get("guardActiveStart"));
-					yamlparams.setGuardActiveEnd(matching.get("guardActiveEnd"));
-					
-					if("GUARD_YAML".equals(ruleProvider)){
-						yamlparams.setLimit(matching.get("limit"));
-						yamlparams.setTimeWindow(matching.get("timeWindow"));
-						yamlparams.setTimeUnits(matching.get("timeUnits"));	
-					}else{
+					if (matching != null) {
+						yamlparams.setActor(matching.get("actor"));
+						yamlparams.setRecipe(matching.get("recipe"));
+						yamlparams.setGuardActiveStart(matching.get("guardActiveStart"));
+						yamlparams.setGuardActiveEnd(matching.get("guardActiveEnd"));
 						
-						List<String> blackList = new ArrayList<>();
+						if("GUARD_YAML".equals(ruleProvider)){
+							yamlparams.setLimit(matching.get("limit"));
+							yamlparams.setTimeWindow(matching.get("timeWindow"));
+							yamlparams.setTimeUnits(matching.get("timeUnits"));	
+						}else{
+							
+							List<String> blackList = new ArrayList<>();
 
-						if(!Strings.isNullOrEmpty(matching.get("blackList"))){
-							String[] blackListArray = matching.get("blackList").split(",");
-							for(String element : blackListArray){
-								blackList.add(element);
-							}					
-						}	
-						
-						yamlparams.setBlackList(blackList);
+							if(!Strings.isNullOrEmpty(matching.get("blackList"))){
+								String[] blackListArray = matching.get("blackList").split(",");
+								for(String element : blackListArray){
+									blackList.add(element);
+								}					
+							}	
+							
+							yamlparams.setBlackList(blackList);
 
-					}					
-					
+						}					
+					}
 					policyData.setYamlparams(yamlparams);
-;					
 				}
 				
 			} else if("Action".equals(parameters.getPolicyClass().toString())){
@@ -216,15 +214,16 @@
 	            policyData.setRuleAlgorithmschoices(ruleAlgorithmChoices);
 	            
 	            ArrayList<Object> attributeList = new ArrayList<>();
-	            
-	            for (String keyField : matching.keySet()) {
-					LinkedHashMap<String, String> attributeMap = new LinkedHashMap<>();
-					String key = keyField;
-					String value = matching.get(keyField);
-					attributeMap.put("key", key);
-					attributeMap.put("value", value);
-					attributeList.add(attributeMap);
-				}	            
+	            if (matching != null) {
+		            for (String keyField : matching.keySet()) {
+						LinkedHashMap<String, String> attributeMap = new LinkedHashMap<>();
+						String key = keyField;
+						String value = matching.get(keyField);
+						attributeMap.put("key", key);
+						attributeMap.put("value", value);
+						attributeList.add(attributeMap);
+					}	
+	            }
 	            
 	            policyData.setAttributes(attributeList);	    
 	            policyData.setActionAttributeValue(parameters.getActionAttribute());
diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImplTest.java b/ONAP-REST/src/test/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImplTest.java
new file mode 100644
index 0000000..7467d4d
--- /dev/null
+++ b/ONAP-REST/src/test/java/org/onap/policy/rest/daoimpl/PolicyValidationDaoImplTest.java
@@ -0,0 +1,441 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-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.rest.daoimpl;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import javax.script.SimpleBindings;
+
+import org.apache.tomcat.dbcp.dbcp2.BasicDataSource;
+import org.h2.tools.Server;
+import org.hibernate.SessionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+//import org.onap.policy.conf.HibernateSession;
+//import org.onap.policy.controller.PolicyController;
+import org.onap.policy.rest.jpa.OnapName;
+import org.onap.policy.rest.jpa.PolicyEntity;
+import org.onap.policy.rest.jpa.PolicyRoles;
+import org.onap.policy.rest.jpa.PolicyVersion;
+import org.onap.policy.rest.jpa.SystemLogDB;
+import org.onap.policy.rest.jpa.UserInfo;
+import org.onap.policy.rest.jpa.WatchPolicyNotificationTable;
+import org.springframework.orm.hibernate4.LocalSessionFactoryBuilder;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.test.annotation.Rollback;
+
+
+public class PolicyValidationDaoImplTest {
+
+	private static Logger logger = FlexLogger.getLogger(PolicyValidationDaoImplTest.class);
+
+	SessionFactory sessionFactory;
+	Server server;
+	PolicyValidationDaoImpl commonClassDao;
+
+	@Before
+	public void setUp() throws Exception{
+		try{
+			BasicDataSource dataSource = new BasicDataSource();
+			dataSource.setDriverClassName("org.h2.Driver");
+			// In-memory DB for testing
+			dataSource.setUrl("jdbc:h2:mem:test");
+			dataSource.setUsername("sa");
+			dataSource.setPassword("");
+			LocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);
+			sessionBuilder.scanPackages("org.onap.*", "com.*");
+
+			Properties properties = new Properties();
+			properties.put("hibernate.show_sql", "false");
+			properties.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
+			properties.put("hibernate.hbm2ddl.auto", "drop");
+			properties.put("hibernate.hbm2ddl.auto", "create");
+
+			sessionBuilder.addProperties(properties);
+			sessionFactory = sessionBuilder.buildSessionFactory();
+
+			// Set up dao with SessionFactory
+			commonClassDao = new PolicyValidationDaoImpl();
+			PolicyValidationDaoImpl.setSessionfactory(sessionFactory);
+			//PolicyController.setLogTableLimit("1");
+			//HibernateSession.setSession(sessionFactory);
+			SystemLogDB data1 = new SystemLogDB();
+			data1.setDate(new Date());
+			data1.setLogtype("INFO");
+			data1.setRemote("Test");
+			data1.setSystem("Test");
+			data1.setType("Test");
+			SystemLogDB data2 = new SystemLogDB();
+			data2.setDate(new Date());
+			data2.setLogtype("error");
+			data2.setRemote("Test");
+			data2.setSystem("Test");
+			data2.setType("Test");
+			//HibernateSession.getSession().save(data1);
+			//HibernateSession.getSession().save(data2);
+			
+			// Create TCP server for troubleshooting
+			server = Server.createTcpServer("-tcpAllowOthers").start();
+			System.out.println("URL: jdbc:h2:" + server.getURL() + "/mem:test");
+
+		}catch(Exception e){
+			System.err.println(e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void testDB(){
+		try{
+			// Add data
+			UserInfo userinfo = new UserInfo();
+			userinfo.setUserLoginId("Test");
+			userinfo.setUserName("Test");
+			commonClassDao.save(userinfo);
+			OnapName onapName = new OnapName();
+			onapName.setOnapName("Test");
+			onapName.setUserCreatedBy(userinfo);
+			onapName.setUserModifiedBy(userinfo);
+			onapName.setModifiedDate(new Date());
+			commonClassDao.save(onapName);
+
+
+			List<Object> list = commonClassDao.getData(OnapName.class);
+			assertTrue(list.size() == 1);
+			logger.debug(list.size());
+			logger.debug(list.get(0));
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void testUser(){
+		try{
+			// Add data
+			UserInfo userinfo = new UserInfo();
+			String loginId_userName = "Test";
+			userinfo.setUserLoginId(loginId_userName);
+			userinfo.setUserName(loginId_userName);
+			commonClassDao.save(userinfo);
+
+
+			List<Object> dataCur = commonClassDao.getDataByQuery("from UserInfo", new SimpleBindings());
+
+			assertEquals(1, dataCur.size());
+			UserInfo cur = (UserInfo) dataCur.get(0);
+			assertEquals(loginId_userName, cur.getUserLoginId());
+			assertEquals(loginId_userName, cur.getUserName());
+
+			assertFalse(dataCur.isEmpty());
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_DashboardController(){
+		try{
+			// Add data
+			PolicyEntity pe = new PolicyEntity();
+			String name = "TestPolicy";
+			pe.setPolicyName(name);
+			pe.setPolicyData("dummyData");
+			pe.prePersist();
+			pe.setScope("dummyScope");
+			pe.setDescription("descr");
+			pe.setDeleted(false);
+			pe.setCreatedBy("Test");
+			commonClassDao.save(pe);
+
+			List<Object> dataCur = commonClassDao.getDataByQuery("from PolicyEntity", new SimpleBindings());
+
+			assertTrue(1 == dataCur.size());
+			assertTrue( dataCur.get(0) instanceof PolicyEntity);
+			assertEquals( name,  ((PolicyEntity)dataCur.get(0)).getPolicyName());
+			assertEquals( pe, ((PolicyEntity)dataCur.get(0)));
+
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_AutoPushController(){
+		try{
+			// Add data
+			PolicyVersion pv = new PolicyVersion();
+			pv.setActiveVersion(2);
+			pv.setPolicyName("myPname");
+			pv.prePersist();
+			pv.setCreatedBy("Test");
+			pv.setModifiedBy("Test");
+
+			PolicyVersion pv2 = new PolicyVersion();
+			pv2.setActiveVersion(1);
+			pv2.setPolicyName("test");
+			pv2.prePersist();
+			pv2.setCreatedBy("Test");
+			pv2.setModifiedBy("Test");
+
+			commonClassDao.save(pv);
+			commonClassDao.save(pv2);
+
+			String scope = "my";
+			scope += "%";
+			String query = "From PolicyVersion where policy_name like :scope and id > 0";
+			SimpleBindings params = new SimpleBindings();
+			params.put("scope", scope);
+			List<Object> dataCur = commonClassDao.getDataByQuery(query, params);
+
+
+			assertTrue(1 == dataCur.size());
+			assertEquals(pv, (PolicyVersion) dataCur.get(0));
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_PolicyNotificationMail(){
+		try{
+			// Add data
+			WatchPolicyNotificationTable watch = new WatchPolicyNotificationTable();
+			String policyFileName = "banana";
+			watch.setLoginIds("Test");
+			watch.setPolicyName("bananaWatch");
+			commonClassDao.save(watch);
+
+			if(policyFileName.contains("/")){
+				policyFileName = policyFileName.substring(0, policyFileName.indexOf("/"));
+				policyFileName = policyFileName.replace("/", File.separator);
+			}
+			if(policyFileName.contains("\\")){
+				policyFileName = policyFileName.substring(0, policyFileName.indexOf("\\"));
+				policyFileName = policyFileName.replace("\\", "\\\\");
+			}
+
+
+			// Current Implementation
+			policyFileName += "%";
+			String query = "from WatchPolicyNotificationTable where policyName like:policyFileName";
+			SimpleBindings params = new SimpleBindings();
+			params.put("policyFileName", policyFileName);
+			List<Object> dataCur = commonClassDao.getDataByQuery(query, params);
+
+			// Assertions
+			assertTrue(dataCur.size() == 1);
+			assertTrue(dataCur.get(0) instanceof WatchPolicyNotificationTable);
+			assertEquals(watch, (WatchPolicyNotificationTable) dataCur.get(0));
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_PolicyController(){
+		try{
+			// Add data
+			PolicyEntity pe = new PolicyEntity();
+			String name = "actionDummy";
+			pe.setPolicyName(name);
+			pe.setPolicyData("dummyData");
+			pe.prePersist();
+			pe.setScope("dummyScope");
+			pe.setDescription("descr");
+			pe.setDeleted(false);
+			pe.setCreatedBy("Test");
+			commonClassDao.save(pe);
+
+			String dbCheckName = "dummyScope:action";
+			String[] splitDBCheckName = dbCheckName.split(":");
+
+
+			// Current Implementation
+			String query =   "FROM PolicyEntity where policyName like :splitDBCheckName1 and scope = :splitDBCheckName0";
+			SimpleBindings params = new SimpleBindings();
+			params.put("splitDBCheckName1", splitDBCheckName[1] + "%");
+			params.put("splitDBCheckName0", splitDBCheckName[0]);
+			List<Object> dataCur = commonClassDao.getDataByQuery(query, params);
+
+			// Assertions
+			assertTrue(dataCur.size() == 1);
+			assertTrue(dataCur.get(0) instanceof PolicyEntity);
+			assertEquals(pe, (PolicyEntity) dataCur.get(0));
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_PolicyNotificationController(){
+		try{
+			// Add data
+			WatchPolicyNotificationTable watch = new WatchPolicyNotificationTable();
+			String finalName = "banana"; // Policy File Name
+			String userId = "Test";
+			watch.setLoginIds(userId);
+			watch.setPolicyName(finalName);
+			commonClassDao.save(watch);
+
+
+			// Current Implementation
+			String query = "from WatchPolicyNotificationTable where POLICYNAME = :finalName and LOGINIDS = :userId";
+			SimpleBindings params = new SimpleBindings();
+			params.put("finalName", finalName);
+			params.put("userId", userId);
+			List<Object> dataCur = commonClassDao.getDataByQuery(query, params);
+
+			// Assertions
+			assertTrue(dataCur.size() == 1);
+			assertTrue(dataCur.get(0) instanceof WatchPolicyNotificationTable);
+			assertEquals(watch, (WatchPolicyNotificationTable) dataCur.get(0) );
+
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	
+	 /* Test for SQL Injection Protection
+	 */
+	 
+	@Test
+	@Transactional
+    @Rollback(true)
+	public void getDataByQuery_PolicyNotificationController_Injection(){
+		try{
+			// Add data
+			WatchPolicyNotificationTable watch = new WatchPolicyNotificationTable();
+			String userId = "Test";
+			watch.setLoginIds(userId);
+			watch.setPolicyName("banana");
+			commonClassDao.save(watch);
+
+			WatchPolicyNotificationTable watch2 = new WatchPolicyNotificationTable();
+			watch2.setLoginIds(userId);
+			watch2.setPolicyName("banana2");
+			commonClassDao.save(watch2);
+
+			// SQL Injection attempt
+			String finalName = "banana' OR '1'='1";
+
+
+			// Current Implementation
+			String query = "from WatchPolicyNotificationTable where POLICYNAME = :finalName and LOGINIDS = :userId";
+			SimpleBindings params = new SimpleBindings();
+			params.put("finalName", finalName);
+			params.put("userId", userId);
+			List<Object> dataCur = commonClassDao.getDataByQuery(query, params);
+
+			// Assertions
+			assertTrue(dataCur.size() <= 1);
+
+			if(dataCur.size() >= 1){
+				assertTrue(dataCur.get(0) instanceof WatchPolicyNotificationTable);
+				assertFalse(watch.equals((WatchPolicyNotificationTable) dataCur.get(0)));
+				assertFalse(watch.equals((WatchPolicyNotificationTable) dataCur.get(0)));
+			}
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+	
+	@Test
+	public void testCommonClassDaoImplMethods(){
+		try{
+			UserInfo userInfo = new UserInfo();
+			userInfo.setUserLoginId("TestID");
+			userInfo.setUserName("Test");
+			commonClassDao.save(userInfo);
+			List<Object> data = commonClassDao.getDataById(UserInfo.class, "userLoginId:userName", "TestID:Test");
+			assertTrue(data.size() == 1);
+			UserInfo userInfoUpdate = (UserInfo) data.get(0);
+			userInfoUpdate.setUserName("Test1");
+			commonClassDao.update(userInfoUpdate);
+			List<String> data1 = commonClassDao.getDataByColumn(UserInfo.class, "userLoginId");
+			assertTrue(data1.size() == 1);
+			UserInfo data2 = (UserInfo) commonClassDao.getEntityItem(UserInfo.class, "userLoginId:userName", "TestID:Test1");
+			assertTrue("TestID".equals(data2.getUserLoginId()));
+			List<Object> data3 = commonClassDao.checkDuplicateEntry("TestID:Test1", "userLoginId:userName", UserInfo.class);
+			assertTrue(data3.size() == 1);
+			PolicyRoles roles = new PolicyRoles();
+			roles.setRole("admin");
+			roles.setLoginId(userInfo);
+			roles.setScope("test");
+			commonClassDao.save(roles);
+			List<PolicyRoles> roles1 = commonClassDao.getUserRoles();
+			assertTrue(roles1.size() == 1);
+			List<String> multipleData = new ArrayList<>();
+			multipleData.add("TestID:Test1");
+			List<Object> data4 = commonClassDao.getMultipleDataOnAddingConjunction(UserInfo.class, "userLoginId:userName", multipleData);
+			assertTrue(data4.size() == 1);
+			commonClassDao.delete(data2);
+		}catch(Exception e){
+			logger.debug("Exception Occured"+e);
+			fail();
+		}
+	}
+
+	@After
+	public void deleteDB(){
+		sessionFactory.close();
+		server.stop();
+
+	}
+
+}
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
index cb373a1..151d36a 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
@@ -1448,7 +1448,7 @@
 				policyAdapter.setReadOnly(false);
 				policyAdapter.setEditPolicy(true);
 			}
-			policyAdapter.setDomain(domain);
+			
 			policyAdapter.setDomainDir(domain);
 			policyAdapter.setPolicyData(policy);
 			String policyName = path.replace(".xml", "");
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyValidationController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyValidationController.java
index 9a1aac1..ed32f29 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyValidationController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyValidationController.java
@@ -46,14 +46,6 @@
 public class PolicyValidationController extends RestrictedBaseController {
 
 	private static final Logger LOGGER	= FlexLogger.getLogger(PolicyValidationController.class);
-	
-	public static final String CONFIG_POLICY = "Config";
-	public static final String ACTION_POLICY = "Action";
-	public static final String DECISION_POLICY = "Decision";
-	public static final String CLOSEDLOOP_POLICY = "ClosedLoop_Fault";
-	public static final String CLOSEDLOOP_PM = "ClosedLoop_PM";
-	public static final String ENFORCER_CONFIG_POLICY= "Enforcer Config";
-	public static final String MICROSERVICES="Micro Service";
 
 	@RequestMapping(value={"/policyController/validate_policy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
 	public ModelAndView validatePolicy(HttpServletRequest request, HttpServletResponse response) throws IOException{
