diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
index 5b596be..b185725 100644
--- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
+++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MsModelUtils.java
@@ -202,7 +202,6 @@
             processXmiEpackage(file);
         }
         return classMap;
-
     }
 
     /**
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 6bab919..adb8995 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
@@ -47,6 +47,8 @@
 import javax.json.JsonReader;
 import javax.json.JsonValue;
 
+import lombok.Getter;
+
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
 
@@ -113,6 +115,7 @@
     private static Map<String, String> jsonRequestMap = new HashMap<>();
     private static List<String> modelRequiredFieldsList = new ArrayList<>();
 
+    @Getter
     private static CommonClassDao commonClassDao;
 
     private Set<String> allReqTrueKeys = new HashSet<>();
@@ -230,7 +233,7 @@
             // Decision Policy Attributes Validation
             if (!"API".equals(policyData.getApiflag()) && policyData.getSettings() != null
                             && !policyData.getSettings().isEmpty()) {
-                for (Object attribute : policyData.getAttributes()) {
+                for (Object attribute : policyData.getSettings()) {
                     if (attribute instanceof LinkedHashMap<?, ?>) {
                         String value = null;
                         if (((LinkedHashMap<?, ?>) attribute).get("key") == null) {
diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/util/PolicyValidationTest.java b/ONAP-REST/src/test/java/org/onap/policy/rest/util/PolicyValidationTest.java
index 47b0f49..3efb825 100644
--- a/ONAP-REST/src/test/java/org/onap/policy/rest/util/PolicyValidationTest.java
+++ b/ONAP-REST/src/test/java/org/onap/policy/rest/util/PolicyValidationTest.java
@@ -21,11 +21,18 @@
 
 package org.onap.policy.rest.util;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
 
+import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import org.junit.After;
@@ -33,6 +40,7 @@
 import org.junit.Test;
 import org.onap.policy.api.PolicyConfigType;
 import org.onap.policy.api.PolicyParameters;
+import org.onap.policy.common.utils.resources.TextFileUtils;
 import org.onap.policy.rest.adapter.PolicyRestAdapter;
 
 public class PolicyValidationTest {
@@ -54,19 +62,7 @@
         policyParameters.setPolicyDescription("This is a sample Micro Service policy Create example");
         policyParameters.setOnapName("DCAE");
         policyParameters.setPriority("1");
-        String msJsonString = "{\"service\":\"TOSCA_namingJenny\",\"location\":\"Test  DictMSLoc\","
-                        + "\"uuid\":\"testDict  DCAEUIID\",\"policyName\":\"testModelValidation\","
-                        + "\"description\":\"test\",\"configName\":\"testDict  MSConfName\","
-                        + "\"templateVersion\":\"1607\",\"version\":\"gw12181031\",\"priority\":\"5\","
-                        + "\"policyScope\":\"resource=ResourcetypeVenktest1,service=ServiceName1707,type=Name1707,"
-                        + "closedLoopControlName=Retest_retest1\",\"riskType\":\"Test\",\"riskLevel\":\"3\","
-                        + "\"guard\":\"True\",\"content\":{\"police-instance-name\":\"testing\","
-                        + "\"naming-models\":[{\"naming-properties\":[{\"property-value\":\"test\","
-                        + "\"source-endpoint\":\"test\",\"property-name\":\"testPropertyname\","
-                        + "\"increment-sequence\":{\"scope\":\"VNF\",\"start-value\":\"1\",\"length\":\"3\","
-                        + "\"increment\":\"2\"},\"source-system\":\"TOSCA\"}],\"naming-type\":\"testNamingType\","
-                        + "\"naming-recipe\":\"testNamingRecipe\"}]}}";
-        ;
+        String msJsonString = TextFileUtils.getTextFileAsString("src/test/resources/policies/MicroServicePolicy.json");
         policyParameters.setConfigBody(msJsonString);
         policyParameters.setRequestID(UUID.randomUUID());
         SimpleDateFormat dateformat3 = new SimpleDateFormat("dd/MM/yyyy");
@@ -80,10 +76,32 @@
         PolicyValidationRequestWrapper wrapper = new PolicyValidationRequestWrapper();
         PolicyRestAdapter policyData = wrapper.populateRequestParameters(policyParameters);
         PolicyValidation validation = new PolicyValidation();
-        StringBuilder responseString = validation.validatePolicy(policyData);
+        String responseString = validation.validatePolicy(policyData).toString();
 
-        assertNotSame("success", responseString.toString());
+        assertNotSame("success", responseString);
 
+        new PolicyValidation(null);
+        assertNull(PolicyValidation.getCommonClassDao());
+
+        policyData.setConfigPolicyType("ClosedLoop_Fault");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).doesNotContain("success");
+
+        policyData.setConfigPolicyType("ClosedLoop_PM");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).doesNotContain("success");
+
+        policyData.setConfigPolicyType("Enforcer Config");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).doesNotContain("success");
+
+        policyData.setConfigPolicyType("Optimization");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).doesNotContain("success");
+
+        policyData.setConfigPolicyType("Strange");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).doesNotContain("success");
     }
 
     @Test
@@ -93,4 +111,234 @@
         assertEquals("success", result);
     }
 
+    @Test
+    public void testPolicyHeadingValidation() throws IOException {
+        PolicyValidation validation = new PolicyValidation();
+        PolicyRestAdapter policyData = new PolicyRestAdapter();
+
+        String responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("PolicyName Should not be empty");
+
+        policyData.setPolicyName("%%%~~~%%%");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("The Value in Required Field will allow only '{0-9}, {a-z}, {A-Z}");
+
+        policyData.setPolicyName("ALegalPolicyName");
+        policyData.setPolicyDescription("@CreatedBy:");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString)
+                        .contains("The value in the description shouldn't contain @CreatedBy: or @ModifiedBy:");
+        policyData.setPolicyDescription("@CreatedBy:");
+
+        policyData.setPolicyDescription("A Legal Description");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString)
+                        .doesNotContain("The value in the description shouldn't contain @CreatedBy: or @ModifiedBy:");
+    }
+
+    @Test
+    public void testPolicyAttributeValidation() throws IOException {
+        PolicyValidation validation = new PolicyValidation();
+        PolicyRestAdapter policyData = new PolicyRestAdapter();
+        policyData.setPolicyName("ALegalPolicyName");
+        policyData.setPolicyDescription("A Valid Description");
+
+        String responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("API");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("NOTAPI");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        List<Object> attributes = new ArrayList<>();
+        policyData.setAttributes(attributes);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        attributes.add(new String("hello"));
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+        attributes.clear();
+
+        Map<String, String> mapAttribute = new LinkedHashMap<>();
+        attributes.add(mapAttribute);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Component Attributes</b>:<i> has one missing Component Attribute value");
+
+        mapAttribute.put("key", "value");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>Component Attributes</b>:<i> has one missing Component Attribute value</i><br>",
+                        responseString);
+
+        mapAttribute.put("key", "");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>Attributes or Component Attributes</b>:<i>null : value has spaces or invalid characters</i>"
+                        + "<br><b>Component Attributes</b>:<i> has one missing Component Attribute value</i><br>",
+                        responseString);
+        mapAttribute.clear();
+
+        responseString = validation.validatePolicy(policyData).toString();
+        mapAttribute.put("hello", "aaa");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>Component Attributes</b>:<i> has one missing Component Attribute key</i><br>"
+                        + "<b>Component Attributes</b>:<i> has one missing Component Attribute value</i><br>",
+                        responseString);
+
+        policyData.setPolicyType("Config");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>RiskType</b>: Risk Type Should not be Empty</i><br>"
+                        + "<b>RiskLevel</b>: Risk Level Should not be Empty</i><br>"
+                        + "<b>Guard</b>: Guard Value Should not be Empty</i><br>", responseString);
+
+        policyData.setConfigPolicyType("Base");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("has one missing Attribute key");
+
+        policyData.setConfigPolicyType("BRMS_Param");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("has one missing Attribute key");
+
+        policyData.setConfigPolicyType("BRMS_Raw");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("has one missing Attribute key");
+
+        policyData.setConfigPolicyType(null);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Risk Level Should not be Empty");
+
+        mapAttribute.clear();
+        mapAttribute.put("value", "thevalue");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Risk Level Should not be Empty");
+
+        mapAttribute.put("value", "$$$%%%%");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Risk Level Should not be Empty");
+
+        policyData.setConfigPolicyType("Base");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("value has spaces or invalid characters");
+
+        policyData.setConfigPolicyType("BRMS_Param");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("value has spaces or invalid characters");
+
+        policyData.setConfigPolicyType("BRMS_Raw");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("value has spaces or invalid characters");
+
+        policyData.setConfigPolicyType(null);
+        policyData.setPolicyType(null);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("value has spaces or invalid characters");
+    }
+
+    @Test
+    public void testPolicySettingsValidation() throws IOException {
+        PolicyValidation validation = new PolicyValidation();
+        PolicyRestAdapter policyData = new PolicyRestAdapter();
+        policyData.setPolicyName("ALegalPolicyName");
+        policyData.setPolicyDescription("A Valid Description");
+
+        String responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("API");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("NOTAPI");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        List<Object> settings = new ArrayList<>();
+        policyData.setSettings(settings);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        settings.add("hello");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+        settings.clear();
+
+        Map<String, String> mapSetting = new LinkedHashMap<>();
+        settings.add(mapSetting);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Settings Attributes</b>:<i> has one missing Attribute key");
+
+        mapSetting.put("key", "value");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>Settings Attributes</b>:<i> has one missing Attribute Value</i><br>", responseString);
+
+        mapSetting.put("key", "");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("<b>Settings Attributes</b>:<i> has one missing Attribute Value</i><br>", responseString);
+        mapSetting.clear();
+
+        mapSetting.put("value", "thevalue");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("has one missing Attribute key");
+
+        mapSetting.put("value", "$$$%%%");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("value has spaces or invalid characters");
+    }
+
+    @Test
+    public void testPolicyRuleAlgorithmsValidation() throws IOException {
+        PolicyValidation validation = new PolicyValidation();
+        PolicyRestAdapter policyData = new PolicyRestAdapter();
+        policyData.setPolicyName("ALegalPolicyName");
+        policyData.setPolicyDescription("A Valid Description");
+
+        String responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("API");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        policyData.setApiflag("NOTAPI");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        List<Object> ruleAlgorithmschoices = new ArrayList<>();
+        policyData.setRuleAlgorithmschoices(ruleAlgorithmschoices);
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        ruleAlgorithmschoices.add("hello");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+        ruleAlgorithmschoices.clear();
+
+        Map<String, String> mapChoice = new LinkedHashMap<>();
+        ruleAlgorithmschoices.add(mapChoice);
+        assertNull(validation.validatePolicy(policyData));
+
+        mapChoice.clear();
+        mapChoice.put("id", "TheID");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Field 1 value is not selected");
+
+        mapChoice.put("dynamicRuleAlgorithmField1", "Field1");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Field 2 value is not selected");
+
+        mapChoice.put("dynamicRuleAlgorithmCombo", "Combo");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Field 3 value is empty");
+
+        mapChoice.put("dynamicRuleAlgorithmField2", "Field2");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertEquals("success", responseString);
+
+        mapChoice.put("dynamicRuleAlgorithmField2", "%%%$$$");
+        responseString = validation.validatePolicy(policyData).toString();
+        assertThat(responseString).contains("Field 3 value has special characters");
+    }
 }
diff --git a/ONAP-REST/src/test/resources/policies/MicroServicePolicy.json b/ONAP-REST/src/test/resources/policies/MicroServicePolicy.json
new file mode 100644
index 0000000..b9c06e5
--- /dev/null
+++ b/ONAP-REST/src/test/resources/policies/MicroServicePolicy.json
@@ -0,0 +1,38 @@
+{
+    "service": "TOSCA_namingJenny",
+    "location": "Test  DictMSLoc",
+    "uuid": "testDict  DCAEUIID",
+    "policyName": "testModelValidation",
+    "description": "test",
+    "configName": "testDict  MSConfName",
+    "templateVersion": "1607",
+    "version": "gw12181031",
+    "priority": "5",
+    "policyScope": "resource=ResourcetypeVenktest1,service=ServiceName1707,type=Name1707,closedLoopControlName=Retest_retest1",
+    "riskType": "Test",
+    "riskLevel": "3",
+    "guard": "True",
+    "content": {
+        "police-instance-name": "testing",
+        "naming-models": [
+            {
+                "naming-properties": [
+                    {
+                        "property-value": "test",
+                        "source-endpoint": "test",
+                        "property-name": "testPropertyname",
+                        "increment-sequence": {
+                            "scope": "VNF",
+                            "start-value": "1",
+                            "length": "3",
+                            "increment": "2"
+                        },
+                        "source-system": "TOSCA"
+                    }
+                ],
+                "naming-type": "testNamingType",
+                "naming-recipe": "testNamingRecipe"
+            }
+        ]
+    }
+}
