diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index ed91283..773332d 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -27,7 +27,6 @@
 package org.onap.clamp.loop;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -65,6 +64,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
@@ -223,7 +223,8 @@
 
     @Test(expected = SdcArtifactInstallerException.class)
     @Transactional
-    public void shouldThrowSdcArtifactInstallerException() throws SdcArtifactInstallerException, SdcToscaParserException, IOException, InterruptedException, PolicyModelException {
+    public void shouldThrowSdcArtifactInstallerException() throws SdcArtifactInstallerException,
+        SdcToscaParserException, IOException, InterruptedException, PolicyModelException {
         String generatedName = RandomStringUtils.randomAlphanumeric(5);
         CsarHandler csarHandler = buildFakeCsarHandler(generatedName);
         Mockito.when(csarHandler.getMapOfBlueprints()).thenThrow(IOException.class);
diff --git a/src/test/java/org/onap/clamp/loop/DcaeComponentTest.java b/src/test/java/org/onap/clamp/loop/DcaeComponentTest.java
new file mode 100644
index 0000000..0a3c1e1
--- /dev/null
+++ b/src/test/java/org/onap/clamp/loop/DcaeComponentTest.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 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.loop;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
+
+import java.io.IOException;
+import java.util.HashSet;
+
+import org.junit.Test;
+import org.onap.clamp.clds.model.dcae.DcaeOperationStatusResponse;
+import org.onap.clamp.loop.components.external.DcaeComponent;
+import org.onap.clamp.policy.microservice.MicroServicePolicy;
+
+public class DcaeComponentTest {
+
+    private Loop createTestLoop() {
+        String yaml = "imports:\n" + "  - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n"
+            + "node_templates:\n" + "  docker_service_host:\n" + "    type: dcae.nodes.SelectedDockerHost";
+
+        Loop loopTest = new Loop("ControlLoopTest", yaml, "<xml></xml>");
+        loopTest.setGlobalPropertiesJson(
+            new Gson().fromJson("{\"dcaeDeployParameters\":" + "{\"policy_id\": \"name\"}}", JsonObject.class));
+        loopTest.setLastComputedState(LoopState.DESIGN);
+        loopTest.setDcaeDeploymentId("123456789");
+        loopTest.setDcaeDeploymentStatusUrl("http4://localhost:8085");
+        loopTest.setDcaeBlueprintId("UUID-blueprint");
+
+        MicroServicePolicy microServicePolicy = new MicroServicePolicy("configPolicyTest", "",
+            "tosca_definitions_version: tosca_simple_yaml_1_0_0", true,
+            new Gson().fromJson("{\"configtype\":\"json\"}", JsonObject.class), new HashSet<>());
+        microServicePolicy.setProperties(new Gson().fromJson("{\"param1\":\"value1\"}", JsonObject.class));
+
+        loopTest.addMicroServicePolicy(microServicePolicy);
+        return loopTest;
+    }
+
+    @Test
+    public void convertDcaeResponseTest() throws IOException {
+        String dcaeFakeResponse = "{'requestId':'testId','operationType':'install','status':'state','error':'errorMessage', 'links':{'self':'selfUrl','uninstall':'uninstallUrl'}}";
+        DcaeOperationStatusResponse responseObject = DcaeComponent.convertDcaeResponse(dcaeFakeResponse);
+        assertThat(responseObject.getRequestId()).isEqualTo("testId");
+        assertThat(responseObject.getOperationType()).isEqualTo("install");
+        assertThat(responseObject.getStatus()).isEqualTo("state");
+        assertThat(responseObject.getError()).isEqualTo("errorMessage");
+        assertThat(responseObject.getLinks()).isNotNull();
+        assertThat(responseObject.getLinks().getSelf()).isEqualTo("selfUrl");
+        assertThat(responseObject.getLinks().getUninstall()).isEqualTo("uninstallUrl");
+
+        assertThat(responseObject.getLinks().getStatus()).isNull();
+    }
+
+    @Test
+    public void testGetDeployPayload() throws IOException {
+        Loop loop = this.createTestLoop();
+        String deploymentPayload = DcaeComponent.getDeployPayload(loop);
+        String expectedPayload = "{\"serviceTypeId\":\"UUID-blueprint\",\"inputs\":{\"policy_id\":\"name\"}}";
+        assertThat(deploymentPayload).isEqualTo(expectedPayload);
+    }
+
+    @Test
+    public void testGetUndeployPayload() throws IOException {
+        Loop loop = this.createTestLoop();
+        String unDeploymentPayload = DcaeComponent.getUndeployPayload(loop);
+        String expectedPayload = "{\"serviceTypeId\":\"UUID-blueprint\"}";
+        assertThat(unDeploymentPayload).isEqualTo(expectedPayload);
+    }
+
+}
diff --git a/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java b/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java
deleted file mode 100644
index a2c97e0..0000000
--- a/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2019 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.loop;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonObject;
-
-import java.io.IOException;
-import java.util.HashSet;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.json.simple.parser.ParseException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.onap.clamp.clds.Application;
-import org.onap.clamp.loop.LoopOperation.TempLoopState;
-import org.onap.clamp.policy.microservice.MicroServicePolicy;
-import org.onap.clamp.policy.operational.OperationalPolicy;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-public class LoopOperationTestItCase {
-
-    private Gson gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create();
-    @Autowired
-    LoopService loopService;
-
-    private Loop createTestLoop() {
-        String yaml = "imports:\n" + "  - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n"
-            + "node_templates:\n" + "  docker_service_host:\n" + "    type: dcae.nodes.SelectedDockerHost";
-
-        Loop loopTest = new Loop("ControlLoopTest", yaml, "<xml></xml>");
-        loopTest.setGlobalPropertiesJson(
-            new Gson().fromJson("{\"dcaeDeployParameters\":" + "{\"policy_id\": \"name\"}}", JsonObject.class));
-        loopTest.setLastComputedState(LoopState.DESIGN);
-        loopTest.setDcaeDeploymentId("123456789");
-        loopTest.setDcaeDeploymentStatusUrl("http4://localhost:8085");
-        loopTest.setDcaeBlueprintId("UUID-blueprint");
-
-        MicroServicePolicy microServicePolicy = new MicroServicePolicy("configPolicyTest", "",
-            "tosca_definitions_version: tosca_simple_yaml_1_0_0", true,
-            gson.fromJson("{\"configtype\":\"json\"}", JsonObject.class), new HashSet<>());
-        microServicePolicy.setProperties(new Gson().fromJson("{\"param1\":\"value1\"}", JsonObject.class));
-
-        loopTest.addMicroServicePolicy(microServicePolicy);
-        return loopTest;
-    }
-
-    @Test
-    public void testAnalysePolicyResponse() {
-        LoopOperation loopOp = new LoopOperation(loopService);
-        String status1 = loopOp.analysePolicyResponse(200);
-        String status2 = loopOp.analysePolicyResponse(404);
-        String status3 = loopOp.analysePolicyResponse(500);
-        String status4 = loopOp.analysePolicyResponse(503);
-
-        // then
-        assertThat(status1).isEqualTo("SUBMITTED");
-        assertThat(status2).isEqualTo("NOT_SUBMITTED");
-        assertThat(status3).isEqualTo("IN_ERROR");
-        assertThat(status4).isEqualTo("IN_ERROR");
-    }
-
-    @Test
-    public void testGetOperationalPolicyName() {
-        LoopOperation loopOp = new LoopOperation(loopService);
-        Loop loop = this.createTestLoop();
-        String opName1 = loopOp.getOperationalPolicyName(loop);
-        assertThat(opName1).isNull();
-
-        OperationalPolicy opPolicy1 = new OperationalPolicy("OperationalPolicyTest1", null,
-            gson.fromJson("{\"type\":\"Operational\"}", JsonObject.class));
-        loop.addOperationalPolicy(opPolicy1);
-        String opName2 = loopOp.getOperationalPolicyName(loop);
-        assertThat(opName2).isEqualTo("OperationalPolicyTest1");
-    }
-
-    @Test
-    public void testAnalyseDcaeResponse() throws ParseException {
-        LoopOperation loopOp = new LoopOperation(loopService);
-        String dcaeStatus1 = loopOp.analyseDcaeResponse(null, null);
-        assertThat(dcaeStatus1).isEqualTo("NOT_DEPLOYED");
-
-        String dcaeStatus2 = loopOp.analyseDcaeResponse(null, 500);
-        assertThat(dcaeStatus2).isEqualTo("IN_ERROR");
-
-        String dcaeStatus3 = loopOp.analyseDcaeResponse(null, 404);
-        assertThat(dcaeStatus3).isEqualTo("NOT_DEPLOYED");
-
-        Exchange camelExchange = Mockito.mock(Exchange.class);
-        Message mockMessage = Mockito.mock(Message.class);
-        Mockito.when(camelExchange.getIn()).thenReturn(mockMessage);
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"install\",\"status\":\"succeeded\"}");
-        String dcaeStatus4 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus4).isEqualTo("DEPLOYED");
-
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"install\",\"status\":\"processing\"}");
-        String dcaeStatus5 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus5).isEqualTo("PROCESSING");
-
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"install\",\"status\":\"failed\"}");
-        String dcaeStatus6 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus6).isEqualTo("IN_ERROR");
-
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"succeeded\"}");
-        String dcaeStatus7 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus7).isEqualTo("NOT_DEPLOYED");
-
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"processing\"}");
-        String dcaeStatus8 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus8).isEqualTo("PROCESSING");
-
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"operationType\":\"uninstall\",\"status\":\"failed\"}");
-        String dcaeStatus9 = loopOp.analyseDcaeResponse(camelExchange, 200);
-        assertThat(dcaeStatus9).isEqualTo("IN_ERROR");
-    }
-
-    @Test
-    public void testUpdateLoopStatus() {
-        LoopOperation loopOp = new LoopOperation(loopService);
-        Loop loop = this.createTestLoop();
-        loopService.saveOrUpdateLoop(loop);
-        LoopState newState1 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.DEPLOYED);
-        LoopState dbState1 = loopService.getLoop(loop.getName()).getLastComputedState();
-        assertThat(newState1).isEqualTo(LoopState.DEPLOYED);
-        assertThat(dbState1).isEqualTo(LoopState.DEPLOYED);
-
-        LoopState newState2 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.NOT_DEPLOYED);
-        LoopState dbState2 = loopService.getLoop(loop.getName()).getLastComputedState();
-        assertThat(newState2).isEqualTo(LoopState.SUBMITTED);
-        assertThat(dbState2).isEqualTo(LoopState.SUBMITTED);
-
-        LoopState newState3 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.PROCESSING);
-        assertThat(newState3).isEqualTo(LoopState.WAITING);
-
-        LoopState newState4 = loopOp.updateLoopStatus(loop, TempLoopState.SUBMITTED, TempLoopState.IN_ERROR);
-        assertThat(newState4).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState5 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.DEPLOYED);
-        assertThat(newState5).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState6 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.PROCESSING);
-        assertThat(newState6).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState7 = loopOp.updateLoopStatus(loop, TempLoopState.NOT_SUBMITTED, TempLoopState.NOT_DEPLOYED);
-        assertThat(newState7).isEqualTo(LoopState.DESIGN);
-
-        LoopState newState8 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.DEPLOYED);
-        assertThat(newState8).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState9 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.NOT_DEPLOYED);
-        assertThat(newState9).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState10 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.PROCESSING);
-        assertThat(newState10).isEqualTo(LoopState.IN_ERROR);
-
-        LoopState newState11 = loopOp.updateLoopStatus(loop, TempLoopState.IN_ERROR, TempLoopState.IN_ERROR);
-        assertThat(newState11).isEqualTo(LoopState.IN_ERROR);
-    }
-
-    @Test
-    public void testUpdateLoopInfo() throws ParseException {
-        Loop loop = this.createTestLoop();
-        loopService.saveOrUpdateLoop(loop);
-
-        Exchange camelExchange = Mockito.mock(Exchange.class);
-        Message mockMessage = Mockito.mock(Message.class);
-        Mockito.when(camelExchange.getIn()).thenReturn(mockMessage);
-        Mockito.when(mockMessage.getBody(String.class))
-            .thenReturn("{\"links\":{\"status\":\"http://testhost/dcae-operationstatus\",\"test2\":\"test2\"}}");
-
-        LoopOperation loopOp = new LoopOperation(loopService);
-        loopOp.updateLoopInfo(camelExchange, loop, "testNewId");
-
-        Loop newLoop = loopService.getLoop(loop.getName());
-        String newDeployId = newLoop.getDcaeDeploymentId();
-        String newDeploymentStatusUrl = newLoop.getDcaeDeploymentStatusUrl();
-
-        assertThat(newDeployId).isEqualTo("testNewId");
-        assertThat(newDeploymentStatusUrl).isEqualTo("http4://testhost/dcae-operationstatus");
-    }
-
-    @Test
-    public void testGetDeploymentId() {
-        Loop loop = this.createTestLoop();
-        LoopOperation loopOp = new LoopOperation(loopService);
-        String deploymentId1 = loopOp.getDeploymentId(loop);
-        assertThat(deploymentId1).isEqualTo("123456789");
-
-        loop.setDcaeDeploymentId(null);
-        String deploymentId2 = loopOp.getDeploymentId(loop);
-        assertThat(deploymentId2).startsWith("CLAMP_");
-
-        loop.setDcaeDeploymentId("");
-        String deploymentId3 = loopOp.getDeploymentId(loop);
-        assertThat(deploymentId3).startsWith("CLAMP_");
-        assertThat(deploymentId3).isNotEqualTo(deploymentId2);
-    }
-
-    @Test
-    public void testGetDeployPayload() throws IOException {
-        Loop loop = this.createTestLoop();
-        LoopOperation loopOp = new LoopOperation(loopService);
-        String deploymentPayload = loopOp.getDeployPayload(loop);
-
-        String expectedPayload = "{\"serviceTypeId\":\"UUID-blueprint\",\"inputs\":{\"policy_id\":\"name\"}}";
-        assertThat(deploymentPayload).isEqualTo(expectedPayload);
-    }
-}
\ No newline at end of file
diff --git a/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java b/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java
index a935808..9a82ec0 100644
--- a/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java
+++ b/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java
@@ -92,7 +92,7 @@
     }
 
     private LoopLog getLoopLog(LogType type, String message, Loop loop) {
-        return new LoopLog(message, type, loop);
+        return new LoopLog(message, type, "CLAMP", loop);
     }
 
     @Test
@@ -116,7 +116,7 @@
         // Now set the ID in the previous model so that we can compare the objects
         loopLog.setId(((LoopLog) loopInDb.getLoopLogs().toArray()[0]).getId());
 
-        assertThat(loopInDb).isEqualToComparingFieldByField(loopTest);
+        assertThat(loopInDb).isEqualToIgnoringGivenFields(loopTest, "components");
         assertThat(loopRepository.existsById(loopTest.getName())).isEqualTo(true);
         assertThat(operationalPolicyService.isExisting(opPolicy.getName())).isEqualTo(true);
         assertThat(microServicePolicyService.isExisting(microServicePolicy.getName())).isEqualTo(true);
@@ -124,7 +124,7 @@
 
         // Now attempt to read from database
         Loop loopInDbRetrieved = loopRepository.findById(loopTest.getName()).get();
-        assertThat(loopInDbRetrieved).isEqualToComparingFieldByField(loopTest);
+        assertThat(loopInDbRetrieved).isEqualToIgnoringGivenFields(loopTest, "components");
         assertThat((LoopLog) loopInDbRetrieved.getLoopLogs().toArray()[0]).isEqualToComparingFieldByField(loopLog);
         assertThat((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0])
             .isEqualToComparingFieldByField(opPolicy);
diff --git a/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java b/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java
index c4254ec..8add1a7 100644
--- a/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java
+++ b/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java
@@ -296,7 +296,7 @@
         saveTestLoopToDb();
         // Add log
         Loop loop = loopsRepository.findById(EXAMPLE_LOOP_NAME).orElse(null);
-        loop.addLog(new LoopLog("test", LogType.INFO, loop));
+        loop.addLog(new LoopLog("test", LogType.INFO, "CLAMP", loop));
         loop = loopService.saveOrUpdateLoop(loop);
         // Add op policy
         OperationalPolicy operationalPolicy = new OperationalPolicy("opPolicy", null,
diff --git a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
index dcad1a5..8899a36 100644
--- a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
+++ b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
@@ -36,6 +36,7 @@
 import org.junit.Test;
 import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.loop.components.external.PolicyComponent;
 import org.onap.clamp.loop.log.LogType;
 import org.onap.clamp.loop.log.LoopLog;
 import org.onap.clamp.policy.microservice.MicroServicePolicy;
@@ -71,7 +72,7 @@
     }
 
     private LoopLog getLoopLog(LogType type, String message, Loop loop) {
-        LoopLog log = new LoopLog(message, type, loop);
+        LoopLog log = new LoopLog(message, type, "CLAMP", loop);
         log.setId(Long.valueOf(new Random().nextInt()));
         return log;
     }
@@ -95,8 +96,12 @@
         System.out.println(jsonSerialized);
         Loop loopTestDeserialized = JsonUtils.GSON_JPA_MODEL.fromJson(jsonSerialized, Loop.class);
         assertNotNull(loopTestDeserialized);
-        assertThat(loopTestDeserialized).isEqualToIgnoringGivenFields(loopTest, "svgRepresentation", "blueprint");
-
+        assertThat(loopTestDeserialized).isEqualToIgnoringGivenFields(loopTest, "svgRepresentation", "blueprint",
+            "components");
+        assertThat(loopTestDeserialized.getComponent("DCAE").getState())
+            .isEqualToComparingFieldByField(loopTest.getComponent("DCAE").getState());
+        assertThat(loopTestDeserialized.getComponent("POLICY").getState())
+            .isEqualToComparingFieldByField(loopTest.getComponent("POLICY").getState());
         // svg and blueprint not exposed so wont be deserialized
         assertThat(loopTestDeserialized.getBlueprint()).isEqualTo(null);
         assertThat(loopTestDeserialized.getSvgRepresentation()).isEqualTo(null);
@@ -121,6 +126,6 @@
         loopTest.addMicroServicePolicy(microServicePolicy);
 
         JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/pdp-group-policy-payload.json"),
-            loopTest.createPoliciesPayloadPdpGroup(), false);
+            PolicyComponent.createPoliciesPayloadPdpGroup(loopTest), false);
     }
 }
diff --git a/src/test/javascript/propertyController.test.js b/src/test/javascript/propertyController.test.js
index fbbc6be..e719996 100644
--- a/src/test/javascript/propertyController.test.js
+++ b/src/test/javascript/propertyController.test.js
@@ -30,16 +30,4 @@
 	test('getMsUINotExist', () => {
 		  expect(propertyController.getMsUI("test")).toEqual(null);
 	});
-
-	test('getLastUpdatedStatus', () => {
-		  expect(propertyController.getLastUpdatedStatus()).toEqual('DESIGN');
-	});
-
-	test('getDeploymentID', () => {
-		  expect(propertyController.getDeploymentID()).toEqual('testId');
-	});
-
-	test('getDeploymentStatusURL', () => {
-		  expect(propertyController.getDeploymentStatusURL()).toEqual('testUrl');
-	});
 });
\ 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 0db977b..ce61ea0 100755
--- a/src/test/resources/http-cache/third_party_proxy.py
+++ b/src/test/resources/http-cache/third_party_proxy.py
@@ -127,10 +127,28 @@
             with open(cached_file_content, 'w') as f:
                 f.write(jsonGenerated)
         return True
-     elif self.path.startswith("/dcae-operationstatus") and http_type == "GET":
+     elif self.path.startswith("/dcae-operationstatus/install") and http_type == "GET":
         if not _file_available:
-            print "self.path start with /dcae-operationstatus, generating response json..."
-            jsonGenerated =  "{\"operationType\": \"operationType1\", \"status\": \"succeeded\"}"
+            print "self.path start with /dcae-operationstatus/install, generating response json..."
+            jsonGenerated =  "{\"operationType\": \"install\", \"status\": \"succeeded\"}"
+            print "jsonGenerated: " + jsonGenerated
+    
+            try:
+                os.makedirs(cached_file_folder, 0777)
+            except OSError as e:
+                if e.errno != errno.EEXIST:
+                    raise
+                print(cached_file_folder+" already exists")
+    
+            with open(cached_file_header, 'w') as f:
+                f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+            with open(cached_file_content, 'w') as f:
+                f.write(jsonGenerated)
+        return True
+     elif self.path.startswith("/dcae-operationstatus/uninstall") and http_type == "GET":
+        if not _file_available:
+            print "self.path start with /dcae-operationstatus/uninstall, generating response json..."
+            jsonGenerated =  "{\"operationType\": \"uninstall\", \"status\": \"succeeded\"}"
             print "jsonGenerated: " + jsonGenerated
     
             try:
@@ -157,20 +175,31 @@
                 f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
             with open(cached_file_content, 'w') as f:
                 f.write(jsonGenerated)
-        return True;
-     elif self.path.startswith("/dcae-deployments/") and (http_type == "PUT" or http_type == "DELETE"):
-        if not _file_available:
-            print "self.path start with /dcae-deployments/, generating response json..."
-            #jsondata = json.loads(self.data_string)
-            jsonGenerated = "{\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus\",\"test2\":\"test2\"}}"
-            print "jsonGenerated: " + jsonGenerated
-    
-            os.makedirs(cached_file_folder, 0777)
-            with open(cached_file_header, 'w') as f:
-                f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
-            with open(cached_file_content, 'w') as f:
-                f.write(jsonGenerated)
         return True
+     elif self.path.startswith("/dcae-deployments/") and http_type == "PUT":
+            print "self.path start with /dcae-deployments/ DEPLOY, generating response json..."
+            #jsondata = json.loads(self.data_string)
+            jsonGenerated = "{\"operationType\":\"install\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/install\"}}"
+            print "jsonGenerated: " + jsonGenerated
+            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(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+            with open(cached_file_content, 'w+') as f:
+                f.write(jsonGenerated)
+        	return True
+     elif self.path.startswith("/dcae-deployments/") and http_type == "DELETE":
+            print "self.path start with /dcae-deployments/ UNDEPLOY, generating response json..."
+            #jsondata = json.loads(self.data_string)
+            jsonGenerated = "{\"operationType\":\"uninstall\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/uninstall\"}}"
+            print "jsonGenerated: " + jsonGenerated
+            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(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}")
+            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")) or (self.path.startswith("/pdp/api/policyEngineImport") and http_type == "POST"):
         print "self.path start with /pdp/api/, copying body to response ..."
         if not os.path.exists(cached_file_folder):
@@ -180,7 +209,7 @@
         with open(cached_file_content, 'w+') as f:
             f.write(self.data_string)
         return True
-     elif self.path.startswith("/policy/api/v1/policyTypes/") and http_type == "POST":
+     elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "POST":
         print "self.path start with POST new policy API /pdp/api/, copying body to response ..."
         if not os.path.exists(cached_file_folder):
             os.makedirs(cached_file_folder, 0777)
@@ -189,7 +218,7 @@
         with open(cached_file_content, 'w+') as f:
             f.write(self.data_string)
         return True
-     elif self.path.startswith("/policy/api/v1/policyTypes/") and http_type == "DELETE":
+     elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "DELETE":
         print "self.path start with DELETE new policy API /policy/api/v1/policyTypes/ ..."
         if not os.path.exists(cached_file_folder):
             os.makedirs(cached_file_folder, 0777)
@@ -199,6 +228,16 @@
         with open(cached_file_content, 'w+') as f:
                 f.write(self.data_string)
         return True
+     elif self.path.startswith("/policy/pap/v1/pdps/policies") and http_type == "POST":
+        print "self.path start with POST new policy API /policy/pap/v1/pdps/ ..."
+        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("")) + "\", \"Content-Type\": \""+str("")+"\"}")
+        with open(cached_file_content, 'w+') as f:
+                f.write(self.data_string)
+        return True
      elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "GET":
         print "self.path start with /policy/api/v1/policytypes/, generating response json..."
         jsonGenerated =  "{\"policyTypeId\": \"onap.policies.controlloop.operational\",\"policyTypeVersion\": \"1.0.0\",\"policyId\": \"OPERATIONAL_z711F_v1_0_ResourceInstanceName1_tca\"}"
diff --git a/src/test/resources/https/https-test.properties b/src/test/resources/https/https-test.properties
index 7614e17..0be9e29 100644
--- a/src/test/resources/https/https-test.properties
+++ b/src/test/resources/https/https-test.properties
@@ -30,6 +30,7 @@
 server.ssl.key-store=classpath:https/keystore-test.jks
 server.ssl.key-store-password=testpass
 server.ssl.key-password=testpass
+server.ssl.key-store-type=JKS
 
 ### In order to be user friendly when HTTPS is enabled, 
 ### you can add another HTTP port that will be automatically redirected to HTTPS
