diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructor.java b/src/main/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructor.java
index 0b4cbea..afef591 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructor.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructor.java
@@ -38,6 +38,18 @@
 import org.onap.policy.api.RuleProvider;
 
 public class GuardPolicyAttributesConstructor {
+    public static final String ACTOR = "actor";
+    public static final String RECIPE = "recipe";
+    public static final String TARGETS = "targets";
+    public static final String CLNAME = "clname";
+    public static final String MIN = "min";
+    public static final String MAX = "max";
+    public static final String LIMIT = "limit";
+    public static final String TIME_WINDOW = "timeWindow";
+    public static final String TIME_UNITS = "timeUnits";
+    public static final String GUARD_ACTIVE_START = "guardActiveStart";
+    public static final String GUARD_ACTIVE_END = "guardActiveEnd";
+
     private static final EELFLogger logger = EELFManager.getInstance()
         .getLogger(GuardPolicyAttributesConstructor.class);
 
@@ -63,20 +75,20 @@
     private static Map<String, String> prepareMatchingAttributes(PolicyItem policyItem, ModelProperties modelProp) {
         logger.info("Preparing matching attributes for guard...");
         Map<String, String> matchingAttributes = new HashMap<>();
-        matchingAttributes.put("actor", policyItem.getActor());
-        matchingAttributes.put("recipe", policyItem.getRecipe());
-        matchingAttributes.put("targets", policyItem.getGuardTargets());
-        matchingAttributes.put("clname", modelProp.getControlNameAndPolicyUniqueId());
+        matchingAttributes.put(ACTOR, policyItem.getActor());
+        matchingAttributes.put(RECIPE, policyItem.getRecipe());
+        matchingAttributes.put(TARGETS, policyItem.getGuardTargets());
+        matchingAttributes.put(CLNAME, modelProp.getControlNameAndPolicyUniqueId());
         if (RuleProvider.GUARD_MIN_MAX.equals(RuleProvider.valueOf(policyItem.getGuardPolicyType()))) {
-            matchingAttributes.put("min", policyItem.getMinGuard());
-            matchingAttributes.put("max", policyItem.getMaxGuard());
+            matchingAttributes.put(MIN, policyItem.getMinGuard());
+            matchingAttributes.put(MAX, policyItem.getMaxGuard());
         } else if (RuleProvider.GUARD_YAML.equals(RuleProvider.valueOf(policyItem.getGuardPolicyType()))) {
-            matchingAttributes.put("limit", policyItem.getLimitGuard());
-            matchingAttributes.put("timeWindow", policyItem.getTimeWindowGuard());
-            matchingAttributes.put("timeUnits", policyItem.getTimeUnitsGuard());
+            matchingAttributes.put(LIMIT, policyItem.getLimitGuard());
+            matchingAttributes.put(TIME_WINDOW, policyItem.getTimeWindowGuard());
+            matchingAttributes.put(TIME_UNITS, policyItem.getTimeUnitsGuard());
         }
-        matchingAttributes.put("guardActiveStart", policyItem.getGuardActiveStart());
-        matchingAttributes.put("guardActiveEnd", policyItem.getGuardActiveEnd());
+        matchingAttributes.put(GUARD_ACTIVE_START, policyItem.getGuardActiveStart());
+        matchingAttributes.put(GUARD_ACTIVE_END, policyItem.getGuardActiveEnd());
 
         logger.info("Prepared: " + matchingAttributes);
         return matchingAttributes;
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
index 610bd4c..9f25ba9 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
@@ -534,6 +534,7 @@
             deletePolicyParameters.setPolicyName(prop.getCurrentPolicyScopeAndPolicyName());
         }
         logger.info("Policy Name in delete policy method - " + deletePolicyParameters.getPolicyName());
+        logger.info("Deleting policy from PDP...");
         deletePolicyParameters.setPolicyComponent("PDP");
         deletePolicyParameters.setDeleteCondition(DeletePolicyCondition.ALL);
         deletePolicyParameters.setPdpGroup(refProp.getStringValue("policy.pdp.group"));
diff --git a/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java b/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java
new file mode 100644
index 0000000..f163456
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2018 Nokia 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.clamp.clds.client.req.policy;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyChain;
+import org.onap.clamp.clds.model.properties.PolicyItem;
+import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.policy.api.AttributeType;
+import org.onap.policy.controlloop.policy.builder.BuilderException;
+
+public class GuardPolicyAttributesConstructorTest {
+
+    private static final String CONTROL_NAME = "ClosedLoop-d4629aee-970f-11e8-86c9-02552dda865e";
+    private ModelProperties modelProperties;
+    private List<PolicyChain> policyChains;
+
+    @Before
+    public void setUp() throws Exception {
+        String modelProp = ResourceFileUtil
+            .getResourceAsString("example/model-properties/tca_new/model-properties.json");
+        String modelBpmnJson = ResourceFileUtil.getResourceAsString("example/model-properties/tca_new/model-bpmn.json");
+        modelProperties = new ModelProperties("CLAMPDemoVFW_v1_0_3af8daec-6f10-4027-a3540", CONTROL_NAME, "PUT", false,
+            modelBpmnJson, modelProp);
+
+        policyChains = modelProperties.getType(Policy.class).getPolicyChains();
+    }
+
+    @Test
+    public void testRequestAttributes() throws IOException, BuilderException {
+        List<PolicyItem> policyItemsList = GuardPolicyAttributesConstructor
+            .getAllPolicyGuardsFromPolicyChain(policyChains.get(0));
+
+        Assertions.assertThat(policyItemsList.size()).isEqualTo(1);
+
+        // Test first entry
+        Map<AttributeType, Map<String, String>> requestAttributes = GuardPolicyAttributesConstructor
+            .formatAttributes(modelProperties, policyItemsList.get(0));
+
+        Assertions.assertThat(requestAttributes).containsKeys(AttributeType.MATCHING);
+        Map<String, String> ruleParameters = requestAttributes.get(AttributeType.MATCHING);
+        Assertions.assertThat(ruleParameters).contains(Assertions.entry(GuardPolicyAttributesConstructor.ACTOR, "APPC"),
+            Assertions.entry(GuardPolicyAttributesConstructor.RECIPE, "restart"),
+            Assertions.entry(GuardPolicyAttributesConstructor.TARGETS, ".*"),
+            Assertions.entry(GuardPolicyAttributesConstructor.CLNAME,
+                modelProperties.getControlNameAndPolicyUniqueId()),
+            Assertions.entry(GuardPolicyAttributesConstructor.LIMIT, "1"),
+            Assertions.entry(GuardPolicyAttributesConstructor.TIME_WINDOW, "10"),
+            Assertions.entry(GuardPolicyAttributesConstructor.TIME_UNITS, "minute"),
+            Assertions.entry(GuardPolicyAttributesConstructor.GUARD_ACTIVE_START, "00:00:01-05:00"),
+            Assertions.entry(GuardPolicyAttributesConstructor.GUARD_ACTIVE_END, "00:00:00-05:00"));
+    }
+}
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
index 59fad9a..f849a6c 100644
--- a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
@@ -24,156 +24,242 @@
 
 package org.onap.clamp.clds.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
+import java.util.List;
 import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
 
+import javax.xml.transform.TransformerException;
+
+import org.assertj.core.api.Assertions;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.onap.clamp.clds.client.req.policy.GuardPolicyAttributesConstructor;
 import org.onap.clamp.clds.client.req.policy.OperationalPolicyAttributesConstructor;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
 import org.onap.clamp.clds.client.req.tca.TcaRequestFormatter;
 import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.config.PolicyConfiguration;
 import org.onap.clamp.clds.model.CldsEvent;
 import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.model.properties.Policy;
-import org.onap.clamp.clds.model.properties.PolicyChain;
+import org.onap.clamp.clds.model.properties.PolicyItem;
 import org.onap.clamp.clds.model.properties.Tca;
+import org.onap.clamp.clds.transform.XslTransformer;
+import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.policy.api.AttributeType;
+import org.onap.policy.api.PolicyConfigType;
+import org.onap.policy.api.PolicyType;
+import org.onap.policy.controlloop.policy.builder.BuilderException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
 /**
- * Test Policy API in org.onap.clamp.ClampDesigner.client package - replicate
- * Policy Delegates in tests.
+ * Test Policy API, this uses the emulator written in python that is started
+ * during the tests, It returns the payload sent in the policy queries so that
+ * it can be validated here.
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest
 public class PolicyClientItCase {
 
     @Autowired
-    private PolicyConfiguration policyConfiguration;
-    @Autowired
     private ClampProperties refProp;
     @Autowired
     private PolicyClient policyClient;
+    @Autowired
+    XslTransformer cldsBpmnTransformer;
 
     String modelProp;
-    String modelBpmnProp;
     String modelName;
     String controlName;
+    String modelBpmnPropJson;
+    ModelProperties prop;
 
     /**
      * Initialize Test.
+     *
+     * @throws TransformerException
      */
     @Before
-    public void setUp() throws IOException {
-        modelProp = ResourceFileUtil.getResourceAsString("example/model-properties/policy/modelBpmnProperties.json");
-        modelBpmnProp = ResourceFileUtil.getResourceAsString("example/model-properties/policy/modelBpmn.json");
+    public void setUp() throws IOException, TransformerException {
+        modelProp = ResourceFileUtil.getResourceAsString("example/model-properties/tca_new/model-properties.json");
         modelName = "example-model06";
         controlName = "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf";
-    }
-
-    private void createUpdateOperationalPolicy(String actionCd) throws Exception {
-        ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
-        Policy policy = prop.getType(Policy.class);
-        if (policy.isFound()) {
-            for (PolicyChain policyChain : policy.getPolicyChains()) {
-                String operationalPolicyRequestUuid = UUID.randomUUID().toString();
-                Map<AttributeType, Map<String, String>> attributes = OperationalPolicyAttributesConstructor
-                    .formatAttributes(refProp, prop, policy.getId(), policyChain);
-                policyClient.sendBrmsPolicy(attributes, prop, operationalPolicyRequestUuid);
-            }
-        }
-    }
-
-    private void createUpdateTcaPolicy(String actionCd) throws Exception {
-        ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
-        Tca tca = prop.getType(Tca.class);
-        if (tca.isFound()) {
-            String tcaPolicyRequestUuid = UUID.randomUUID().toString();
-            String policyJson = TcaRequestFormatter.createPolicyJson(refProp, prop);
-            try {
-                policyClient.sendMicroServiceInJson(policyJson, prop, tcaPolicyRequestUuid);
-            } catch (Exception e) {
-                assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
-            }
-        }
-    }
-
-    private void deleteOperationalPolicy(String actionCd) throws Exception {
-        ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
-        Policy policy = prop.getType(Policy.class);
-        if (policy.isFound()) {
-            prop.setCurrentModelElementId(policy.getId());
-            for (PolicyChain policyChain : policy.getPolicyChains()) {
-                prop.setPolicyUniqueId(policyChain.getPolicyId());
-                policyClient.deleteBrms(prop);
-            }
-        }
-    }
-
-    private void deleteTcaPolicy(String actionCd) throws Exception {
-        ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
-        Tca tca = prop.getType(Tca.class);
-        if (tca.isFound()) {
-            prop.setCurrentModelElementId(tca.getId());
-            try {
-                policyClient.deleteMicrosService(prop);
-            } catch (Exception e) {
-                assertTrue(e.getMessage().contains("Policy delete failed: PE500 "));
-            }
-        }
-    }
-
-    // @Test
-    /**
-     * Temporarily disabled Test.
-     */
-    public void testCreateUpdateDeleteOperationalPolicy() throws Exception {
-        createUpdateOperationalPolicy(CldsEvent.ACTION_SUBMIT);
-        TimeUnit.SECONDS.sleep(20);
-        deleteOperationalPolicy(CldsEvent.ACTION_DELETE);
+        modelBpmnPropJson = cldsBpmnTransformer.doXslTransformToString(
+            ResourceFileUtil.getResourceAsString("example/model-properties/tca_new/tca-template.xml"));
+        prop = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, false, modelBpmnPropJson,
+            modelProp);
     }
 
     @Test
-    public void testCreateUpdateDeleteTcaPolicy() throws Exception {
-        createUpdateTcaPolicy(CldsEvent.ACTION_SUBMIT);
-        TimeUnit.SECONDS.sleep(20);
-        deleteTcaPolicy(CldsEvent.ACTION_DELETE);
+    public void testSendGuardPolicy() throws TransformerException, IOException {
+        // Normally there is only one Guard
+        List<PolicyItem> policyItems = GuardPolicyAttributesConstructor
+            .getAllPolicyGuardsFromPolicyChain(prop.getType(Policy.class).getPolicyChains().get(0));
+        PolicyItem policyItem = policyItems.get(0);
+        prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
+        prop.setPolicyUniqueId(prop.getType(Policy.class).getPolicyChains().get(0).getPolicyId());
+        prop.setGuardUniqueId(policyItem.getId());
+        String response = policyClient.sendGuardPolicy(
+            GuardPolicyAttributesConstructor.formatAttributes(prop, policyItem), prop, LoggingUtils.getRequestId(),
+            policyItem);
+        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Decision"),
+            Assertions.entry("policyName",
+                modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0_Guard_6TtHGPq"),
+            Assertions.entry("policyDescription", "from clds"), Assertions.entry("onapName", "PDPD"),
+            Assertions.entry("requestID", LoggingUtils.getRequestId()), Assertions.entry("ruleProvider", "GUARD_YAML"));
+
+        // Check Guard attributes
+        Assertions.assertThat((Map<String, Object>) mapNodes.get("attributes"))
+            .containsKey(AttributeType.MATCHING.name());
+        Assertions.assertThat(
+            (Map<String, Object>) ((Map<String, Object>) mapNodes.get("attributes")).get(AttributeType.MATCHING.name()))
+            .contains(Assertions.entry(GuardPolicyAttributesConstructor.ACTOR, "APPC"),
+                Assertions.entry(GuardPolicyAttributesConstructor.CLNAME, controlName + "_0"),
+                Assertions.entry(GuardPolicyAttributesConstructor.TIME_WINDOW, "10"));
     }
 
     @Test
-    public void testPolicyConfiguration() {
-        assertNotNull(policyConfiguration.getPdpUrl1());
-        assertNotNull(policyConfiguration.getPdpUrl2());
-        assertNotNull(policyConfiguration.getPapUrl());
-        assertNotNull(policyConfiguration.getPolicyEnvironment());
-        assertNotNull(policyConfiguration.getClientId());
-        assertNotNull(policyConfiguration.getClientKey());
-        assertNotNull(policyConfiguration.getNotificationType());
-        assertNotNull(policyConfiguration.getNotificationUebServers());
-        assertEquals(8, policyConfiguration.getProperties().size());
-        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL1))
-            .contains("/pdp/ , testpdp, alpha123"));
-        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL2))
-            .contains("/pdp/ , testpdp, alpha123"));
-        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PAP_URL))
-            .contains("/pap/ , testpap, alpha123"));
-        assertEquals("websocket", policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_TYPE));
-        assertEquals("localhost",
-            policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_UEB_SERVERS));
-        assertEquals("python", policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_ID));
-        assertEquals("dGVzdA==", policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_KEY));
-        assertEquals("DEVL", policyConfiguration.getProperties().get(PolicyConfiguration.ENVIRONMENT));
+    public void testSendBrmsPolicy()
+        throws TransformerException, BuilderException, IllegalArgumentException, IOException {
+        Map<AttributeType, Map<String, String>> attributes = OperationalPolicyAttributesConstructor.formatAttributes(
+            refProp, prop, prop.getType(Policy.class).getId(), prop.getType(Policy.class).getPolicyChains().get(0));
+        String response = policyClient.sendBrmsPolicy(attributes, prop, LoggingUtils.getRequestId());
+
+        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0"),
+            Assertions.entry("policyConfigType", PolicyConfigType.BRMS_PARAM.name()),
+            Assertions.entry("requestID", LoggingUtils.getRequestId()));
+
+        // Check BRMS attributes present
+        Assertions.assertThat((Map<String, Object>) mapNodes.get("attributes"))
+            .containsKeys(AttributeType.MATCHING.name(), AttributeType.RULE.name());
+
+    }
+
+    @Test
+    public void testSendMicroServiceInJson()
+        throws TransformerException, BuilderException, IllegalArgumentException, IOException {
+        prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
+        String jsonToSend = "{\"test\":\"test\"}";
+        String response = policyClient.sendMicroServiceInJson(jsonToSend, prop, LoggingUtils.getRequestId());
+
+        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h"),
+            Assertions.entry("policyConfigType", PolicyConfigType.MicroService.name()),
+            Assertions.entry("requestID", LoggingUtils.getRequestId()),
+            Assertions.entry("configBodyType", PolicyType.JSON.name()), Assertions.entry("onapName", "DCAE"),
+            Assertions.entry("configBody", jsonToSend));
+
+    }
+
+    @Test
+    public void testSendBasePolicyInOther() throws IllegalArgumentException, IOException {
+        String body = "test";
+        String response = policyClient.sendBasePolicyInOther(body, "myPolicy", prop, LoggingUtils.getRequestId());
+        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
+            Assertions.entry("policyName", "myPolicy"),
+            Assertions.entry("policyConfigType", PolicyConfigType.Base.name()),
+            Assertions.entry("requestID", LoggingUtils.getRequestId()),
+            Assertions.entry("configBodyType", PolicyType.OTHER.name()), Assertions.entry("onapName", "DCAE"),
+            Assertions.entry("configBody", body));
+    }
+
+    @Test
+    public void testSendMicroServiceInOther() throws IllegalArgumentException, IOException {
+        Tca tca = prop.getType(Tca.class);
+        String tcaJson = TcaRequestFormatter.createPolicyJson(refProp, prop);
+        String response = policyClient.sendMicroServiceInOther(tcaJson, prop);
+
+        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_TCA_1d13unw"),
+            Assertions.entry("policyConfigType", PolicyConfigType.MicroService.name()),
+            Assertions.entry("configBody", tcaJson), Assertions.entry("onapName", "DCAE"));
+    }
+
+    @Test
+    public void testDeleteMicrosService() throws IllegalArgumentException, IOException {
+        Tca tca = prop.getType(Tca.class);
+        prop.setCurrentModelElementId(tca.getId());
+        String[] responses = policyClient.deleteMicrosService(prop).split("\\}\\{");
+
+        // There are 2 responses appended to the result, one for PDP one for PAP !
+        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
+        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+
+        Assertions.assertThat(mapNodesPdp).contains(
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_TCA_1d13unw"),
+            Assertions.entry("policyType", PolicyConfigType.MicroService.name()),
+            Assertions.entry("policyComponent", "PDP"), Assertions.entry("deleteCondition", "ALL"));
+
+        Assertions.assertThat(mapNodesPap).contains(
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_TCA_1d13unw"),
+            Assertions.entry("policyType", PolicyConfigType.MicroService.name()),
+            Assertions.entry("policyComponent", "PAP"), Assertions.entry("deleteCondition", "ALL"));
+    }
+
+    @Test
+    public void testDeleteGuard() throws IllegalArgumentException, IOException {
+        List<PolicyItem> policyItems = GuardPolicyAttributesConstructor
+            .getAllPolicyGuardsFromPolicyChain(prop.getType(Policy.class).getPolicyChains().get(0));
+        prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
+        prop.setPolicyUniqueId(prop.getType(Policy.class).getPolicyChains().get(0).getPolicyId());
+        prop.setGuardUniqueId(policyItems.get(0).getId());
+        String[] responses = policyClient.deleteGuard(prop).split("\\}\\{");
+
+        // There are 2 responses appended to the result, one for PDP one for PAP !
+        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
+        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+
+        Assertions.assertThat(mapNodesPdp).contains(
+            Assertions.entry("policyName",
+                modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0_Guard_6TtHGPq"),
+            Assertions.entry("policyType", "Decision"), Assertions.entry("policyComponent", "PDP"),
+            Assertions.entry("deleteCondition", "ALL"));
+        Assertions.assertThat(mapNodesPap).contains(
+            Assertions.entry("policyName",
+                modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0_Guard_6TtHGPq"),
+            Assertions.entry("policyType", "Decision"), Assertions.entry("policyComponent", "PAP"),
+            Assertions.entry("deleteCondition", "ALL"));
+    }
+
+    @Test
+    public void testDeleteBrms() throws IllegalArgumentException, IOException {
+        prop.setPolicyUniqueId(prop.getType(Policy.class).getPolicyChains().get(0).getPolicyId());
+        prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
+        String[] responses = policyClient.deleteBrms(prop).split("\\}\\{");
+
+        // There are 2 responses appended to the result, one for PDP one for PAP !
+        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
+        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
+            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+
+        Assertions.assertThat(mapNodesPdp).contains(
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0"),
+            Assertions.entry("policyType", "BRMS_Param"), Assertions.entry("policyComponent", "PDP"),
+            Assertions.entry("deleteCondition", "ALL"));
+        Assertions.assertThat(mapNodesPap).contains(
+            Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0"),
+            Assertions.entry("policyType", "BRMS_Param"), Assertions.entry("policyComponent", "PAP"),
+            Assertions.entry("deleteCondition", "ALL"));
+
     }
 }
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyConfigurationItCase.java b/src/test/java/org/onap/clamp/clds/it/PolicyConfigurationItCase.java
new file mode 100644
index 0000000..fd20e36
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/it/PolicyConfigurationItCase.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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.clamp.clds.it;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.clamp.clds.config.PolicyConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * Test Config Policy read from application.properties.
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class PolicyConfigurationItCase {
+
+    @Autowired
+    private PolicyConfiguration policyConfiguration;
+
+    @Test
+    public void testPolicyConfiguration() {
+        assertNotNull(policyConfiguration.getPdpUrl1());
+        assertNotNull(policyConfiguration.getPdpUrl2());
+        assertNotNull(policyConfiguration.getPapUrl());
+        assertNotNull(policyConfiguration.getPolicyEnvironment());
+        assertNotNull(policyConfiguration.getClientId());
+        assertNotNull(policyConfiguration.getClientKey());
+        assertNotNull(policyConfiguration.getNotificationType());
+        assertNotNull(policyConfiguration.getNotificationUebServers());
+        assertEquals(8, policyConfiguration.getProperties().size());
+        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL1))
+            .contains("/pdp/ , testpdp, alpha123"));
+        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PDP_URL2))
+            .contains("/pdp/ , testpdp, alpha123"));
+        assertTrue(((String) policyConfiguration.getProperties().get(PolicyConfiguration.PAP_URL))
+            .contains("/pap/ , testpap, alpha123"));
+        assertEquals("websocket", policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_TYPE));
+        assertEquals("localhost",
+            policyConfiguration.getProperties().get(PolicyConfiguration.NOTIFICATION_UEB_SERVERS));
+        assertEquals("python", policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_ID));
+        assertEquals("dGVzdA==", policyConfiguration.getProperties().get(PolicyConfiguration.CLIENT_KEY));
+        assertEquals("DEVL", policyConfiguration.getProperties().get(PolicyConfiguration.ENVIRONMENT));
+    }
+}
diff --git a/src/test/resources/example/model-properties/tca_new/model-bpmn.json b/src/test/resources/example/model-properties/tca_new/model-bpmn.json
new file mode 100644
index 0000000..84964c5
--- /dev/null
+++ b/src/test/resources/example/model-properties/tca_new/model-bpmn.json
@@ -0,0 +1,21 @@
+{
+	"policy": [
+		{
+			"id": "Policy_12lup3h",
+			"from": "TCA_1d13unw"
+		}
+	],
+	"tca": [
+		{
+			"id": "TCA_1d13unw",
+			"from": "VesCollector_1g9cmz0"
+		}
+	],
+	"holmes": [],
+	"vesCollector": [
+		{
+			"id": "VesCollector_1g9cmz0",
+			"from": "StartEvent_1"
+		}
+	]
+}
\ No newline at end of file
diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py
index a109241..de40ca9 100755
--- a/src/test/resources/http-cache/third_party_proxy.py
+++ b/src/test/resources/http-cache/third_party_proxy.py
@@ -171,6 +171,15 @@
             with open(cached_file_content, 'w') as f:
                 f.write(jsonGenerated)
         return True
+     elif self.path.startswith("/pdp/api/") and http_type == "PUT" or http_type == "DELETE":
+        print "self.path start with /pdp/api/, copying body to response ..."
+        if not os.path.exists(cached_file_folder):
+            os.makedirs(cached_file_folder, 0777)
+        with open(cached_file_header, 'w+') as f:
+            f.write("{\"Content-Length\": \"" + str(len(self.data_string)) + "\", \"Content-Type\": \""+str(self.headers['Content-Type'])+"\"}")
+        with open(cached_file_content, 'w+') as f:
+            f.write(self.data_string)
+        return True
      else:
         return False
 
@@ -328,6 +337,7 @@
         cached_file_header=""
         print("\n\n\nGot a DELETE for %s " % self.path)
         self.check_credentials()
+        self.data_string = self.rfile.read(int(self.headers['Content-Length']))
         print("self.headers:\n %s" % self.headers)
 
         is_special = self._execute_content_generated_cases("DELETE")
