diff --git a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
new file mode 100644
index 0000000..2977d1a
--- /dev/null
+++ b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
@@ -0,0 +1,104 @@
+/*-
+ * ============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.clds.config.spring;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration;
+import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException;
+import org.onap.clamp.clds.sdc.controller.SdcSingleController;
+import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus;
+import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
+import org.onap.clamp.loop.CsarInstallerImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.scheduling.annotation.Scheduled;
+
+@Configuration
+@Profile("clamp-sdc-controller-new")
+public class SdcControllerConfiguration {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcControllerConfiguration.class);
+    private List<SdcSingleController> sdcControllersList = new ArrayList<>();
+    @Autowired
+    private ClampProperties clampProp;
+    @Autowired
+    protected CsarInstaller csarInstaller;
+
+    @PostConstruct
+    public void loadSdcControllers() {
+        SdcControllersConfiguration sdcControllersConfig = getSdcControllersConfiguration();
+        sdcControllersConfig.getAllDefinedControllers().forEach((k, v) -> {
+            logger.info("Creating controller instance:" + k);
+            SdcSingleController sdcController = new SdcSingleController(clampProp, csarInstaller, v, null);
+            sdcControllersList.add(sdcController);
+        });
+    }
+
+    @Scheduled(fixedRate = 120000)
+    public void checkAllSdcControllers() {
+        logger.info("Checking that all SDC Controllers defined are up and running");
+        for (SdcSingleController controller : sdcControllersList) {
+            try {
+                if (SdcSingleControllerStatus.STOPPED.equals(controller.getControllerStatus())) {
+                    controller.initSdc();
+                }
+            } catch (SdcControllerException e) {
+                logger.error("Exception caught when booting sdc controller", e);
+            }
+        }
+        logger.info("SDC Controllers check completed");
+    }
+
+    @PreDestroy
+    public void killSdcControllers() {
+        sdcControllersList.forEach(e -> {
+            try {
+                e.closeSdc();
+            } catch (SdcControllerException e1) {
+                logger.error("Exception caught when stopping sdc controller", e1);
+            }
+        });
+    }
+
+    @Bean(name = "csarInstaller")
+    public CsarInstaller getCsarInstaller() {
+        return new CsarInstallerImpl();
+    }
+
+    @Bean(name = "sdcControllersConfiguration")
+    public SdcControllersConfiguration getSdcControllersConfiguration() {
+        return new SdcControllersConfiguration();
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index 16aee27..542411b 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -26,12 +26,14 @@
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
+
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+
 import org.json.JSONObject;
 import org.springframework.stereotype.Component;
 import org.yaml.snakeyaml.Yaml;
@@ -52,10 +54,8 @@
     private static final String CLAMP_NODE_RELATIONSHIPS_GETS_INPUT_FROM = "clamp_node.relationships.gets_input_from";
     private static final String TARGET = "target";
 
-    BlueprintParser() {}
-
-    Set<MicroService> getMicroServices(String blueprintString) {
-        Set <MicroService> microServices = new HashSet<>();
+    public Set<MicroService> getMicroServices(String blueprintString) {
+        Set<MicroService> microServices = new HashSet<>();
         JsonObject jsonObject = BlueprintParser.convertToJson(blueprintString);
         JsonObject results = jsonObject.get(NODE_TEMPLATES).getAsJsonObject();
 
@@ -70,15 +70,15 @@
         return microServices;
     }
 
-    List<MicroService> fallbackToOneMicroService(String blueprintString) {
+    public List<MicroService> fallbackToOneMicroService(String blueprintString) {
         JsonObject jsonObject = BlueprintParser.convertToJson(blueprintString);
         JsonObject results = jsonObject.get(NODE_TEMPLATES).getAsJsonObject();
         String theBiggestMicroServiceContent = "";
         String theBiggestMicroServiceKey = "";
         for (Entry<String, JsonElement> entry : results.entrySet()) {
             String msAsString = entry.getValue().toString();
-            int len =msAsString.length();
-            if(len > theBiggestMicroServiceContent.length()) {
+            int len = msAsString.length();
+            if (len > theBiggestMicroServiceContent.length()) {
                 theBiggestMicroServiceContent = msAsString;
                 theBiggestMicroServiceKey = entry.getKey();
             }
@@ -105,7 +105,7 @@
             JsonArray relationships = ob.getAsJsonArray(RELATIONSHIPS);
             for (JsonElement element : relationships) {
                 String target = getTarget(element.getAsJsonObject());
-                if(!target.isEmpty()) {
+                if (!target.isEmpty()) {
                     return target;
                 }
             }
@@ -120,9 +120,8 @@
     }
 
     private String getTarget(JsonObject elementObject) {
-        if (elementObject.has(TYPE) &&
-            elementObject.has(TARGET) &&
-            elementObject.get(TYPE).getAsString().equals(CLAMP_NODE_RELATIONSHIPS_GETS_INPUT_FROM)) {
+        if (elementObject.has(TYPE) && elementObject.has(TARGET)
+            && elementObject.get(TYPE).getAsString().equals(CLAMP_NODE_RELATIONSHIPS_GETS_INPUT_FROM)) {
             return elementObject.get(TARGET).getAsString();
         }
         return "";
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
index f2c75ef..b60f072 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
@@ -170,13 +170,13 @@
         return mapOfBlueprints;
     }
 
-    Optional<String> getPolicyModelYaml() throws IOException {
+    public Optional<String> getPolicyModelYaml() throws IOException {
         String result = null;
         try (ZipFile zipFile = new ZipFile(csarFilePath)) {
             ZipEntry entry = zipFile.getEntry(POLICY_DEFINITION_NAME_SUFFIX);
             if (entry != null) {
                 result = IOUtils.toString(zipFile.getInputStream(entry));
-            } else{
+            } else {
                 logger.info("Policy model not found inside the CSAR file: " + csarFilePath);
             }
             return Optional.ofNullable(result);
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
new file mode 100644
index 0000000..9627445
--- /dev/null
+++ b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
@@ -0,0 +1,244 @@
+/*-
+ * ============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 com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+
+import org.json.simple.parser.ParseException;
+import org.onap.clamp.clds.client.DcaeInventoryServices;
+import org.onap.clamp.clds.exception.policy.PolicyModelException;
+import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
+import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse;
+import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
+import org.onap.clamp.clds.sdc.controller.installer.BlueprintParser;
+import org.onap.clamp.clds.sdc.controller.installer.ChainGenerator;
+import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
+import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
+import org.onap.clamp.clds.sdc.controller.installer.MicroService;
+import org.onap.clamp.clds.util.JsonUtils;
+import org.onap.clamp.policy.Policy;
+import org.onap.clamp.policy.microservice.MicroServicePolicy;
+import org.onap.clamp.policy.operational.OperationalPolicy;
+import org.onap.sdc.tosca.parser.enums.SdcTypes;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.yaml.snakeyaml.Yaml;
+
+/**
+ * This class will be instantiated by spring config, and used by Sdc Controller.
+ * There is no state kept by the bean. It's used to deploy the csar/notification
+ * received from SDC in DB.
+ */
+public class CsarInstallerImpl implements CsarInstaller {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(CsarInstallerImpl.class);
+    public static final String TEMPLATE_NAME_PREFIX = "DCAE-Designer-Template-";
+    public static final String CONTROL_NAME_PREFIX = "ClosedLoop-";
+    public static final String GET_INPUT_BLUEPRINT_PARAM = "get_input";
+    // This will be used later as the policy scope
+    public static final String MODEL_NAME_PREFIX = "Loop_";
+
+    @Autowired
+    protected LoopsRepository loopRepository;
+
+    @Autowired
+    private BlueprintParser blueprintParser;
+
+    @Autowired
+    private ChainGenerator chainGenerator;
+
+    @Autowired
+    DcaeInventoryServices dcaeInventoryService;
+
+    @Autowired
+    public void CsarInstallerImpl(LoopsRepository loopRepository, BlueprintParser blueprintParser,
+        ChainGenerator chainGenerator, DcaeInventoryServices dcaeInventoryService) {
+        this.loopRepository = loopRepository;
+        this.blueprintParser = blueprintParser;
+        this.chainGenerator = chainGenerator;
+        this.dcaeInventoryService = dcaeInventoryService;
+    }
+
+    @Override
+    public boolean isCsarAlreadyDeployed(CsarHandler csar) throws SdcArtifactInstallerException {
+        boolean alreadyInstalled = true;
+        for (Entry<String, BlueprintArtifact> blueprint : csar.getMapOfBlueprints().entrySet()) {
+            alreadyInstalled = alreadyInstalled
+                && loopRepository.existsById(buildModelName(csar, blueprint.getValue()));
+        }
+        return alreadyInstalled;
+    }
+
+    public static String buildModelName(CsarHandler csar, BlueprintArtifact artifact) {
+
+        return (MODEL_NAME_PREFIX + "_" + csar.getSdcCsarHelper().getServiceMetadata().getValue("name") + "_v"
+            + csar.getSdcNotification().getServiceVersion() + "_"
+            + artifact.getResourceAttached().getResourceInstanceName().replaceAll(" ", "") + "_"
+            + artifact.getBlueprintArtifactName().replace(".yaml", "")).replace('.', '_');
+    }
+
+    public static String buildOperationalPolicyName(CsarHandler csar, BlueprintArtifact artifact) {
+
+        return (MODEL_NAME_PREFIX + "_" + csar.getSdcCsarHelper().getServiceMetadata().getValue("name") + "_v"
+            + csar.getSdcNotification().getServiceVersion() + "_"
+            + artifact.getResourceAttached().getResourceInstanceName().replaceAll(" ", "") + "_"
+            + artifact.getBlueprintArtifactName().replace(".yaml", "")).replace('.', '_');
+    }
+
+    @Override
+    @Transactional
+    public void installTheCsar(CsarHandler csar)
+        throws SdcArtifactInstallerException, InterruptedException, PolicyModelException {
+        try {
+            logger.info("Installing the CSAR " + csar.getFilePath());
+            for (Entry<String, BlueprintArtifact> blueprint : csar.getMapOfBlueprints().entrySet()) {
+                logger.info("Processing blueprint " + blueprint.getValue().getBlueprintArtifactName());
+                createLoopFromBlueprint(csar, blueprint.getValue());
+            }
+            createPolicyModel(csar);
+            logger.info("Successfully installed the CSAR " + csar.getFilePath());
+        } catch (IOException e) {
+            throw new SdcArtifactInstallerException("Exception caught during the Csar installation in database", e);
+        } catch (ParseException e) {
+            throw new SdcArtifactInstallerException("Exception caught during the Dcae query to get ServiceTypeId", e);
+        }
+    }
+
+    private void createPolicyModel(CsarHandler csar) throws PolicyModelException {
+        try {
+            Optional<String> policyModelYaml = csar.getPolicyModelYaml();
+            // save policy model into the database
+        } catch (IOException e) {
+            throw new PolicyModelException("TransformerException when decoding the YamlText", e);
+        }
+    }
+
+    private Loop createLoopFromBlueprint(CsarHandler csar, BlueprintArtifact blueprintArtifact)
+        throws IOException, ParseException, InterruptedException {
+        Loop newLoop = new Loop();
+        newLoop.setBlueprint(blueprintArtifact.getDcaeBlueprint());
+        newLoop.setName(Loop.generateLoopName(csar.getSdcNotification().getServiceName(),
+            csar.getSdcNotification().getServiceVersion(),
+            blueprintArtifact.getResourceAttached().getResourceInstanceName(),
+            blueprintArtifact.getBlueprintArtifactName()));
+        newLoop.setLastComputedState(LoopState.DESIGN);
+        for (MicroService microService : blueprintParser.getMicroServices(blueprintArtifact.getDcaeBlueprint())) {
+            newLoop.getMicroServicePolicies().add(new MicroServicePolicy(microService.getName(),
+                csar.getPolicyModelYaml().orElse(""), false, new JsonObject(), new HashSet<>(Arrays.asList(newLoop))));
+        }
+        newLoop.setOperationalPolicies(
+            new HashSet<>(Arrays.asList(new OperationalPolicy(Policy.generatePolicyName("OPERATIONAL",
+                csar.getSdcNotification().getServiceName(), csar.getSdcNotification().getServiceVersion(),
+                blueprintArtifact.getResourceAttached().getResourceInstanceName(),
+                blueprintArtifact.getBlueprintArtifactName()), newLoop, new JsonObject()))));
+        // Set SVG XML computed
+        // newLoop.setSvgRepresentation(svgRepresentation);
+        newLoop.setGlobalPropertiesJson(createGlobalPropertiesJson(csar, blueprintArtifact));
+        newLoop.setModelPropertiesJson(createModelPropertiesJson(csar, blueprintArtifact));
+        DcaeInventoryResponse dcaeResponse = queryDcaeToGetServiceTypeId(blueprintArtifact);
+        newLoop.setDcaeBlueprintId(dcaeResponse.getTypeId());
+        return newLoop;
+    }
+
+    private JsonObject createGlobalPropertiesJson(CsarHandler csar, BlueprintArtifact blueprintArtifact) {
+        JsonObject globalProperties = new JsonObject();
+        globalProperties.add("dcaeDeployParameters", getAllBlueprintParametersInJson(blueprintArtifact));
+        return globalProperties;
+
+    }
+
+    private JsonObject createModelPropertiesJson(CsarHandler csar, BlueprintArtifact blueprintArtifact) {
+        JsonObject modelProperties = new JsonObject();
+        Gson gson = new Gson();
+        modelProperties.add("serviceDetails",
+            gson.fromJson(gson.toJson(csar.getSdcCsarHelper().getServiceMetadataAllProperties()), JsonObject.class));
+
+        JsonObject resourcesProp = new JsonObject();
+        for (SdcTypes type : SdcTypes.values()) {
+            JsonObject resourcesPropByType = new JsonObject();
+            for (NodeTemplate nodeTemplate : csar.getSdcCsarHelper().getServiceNodeTemplateBySdcType(type)) {
+                resourcesPropByType.add(nodeTemplate.getName(), JsonUtils.GSON_JPA_MODEL
+                    .fromJson(new Gson().toJson(nodeTemplate.getMetaData().getAllProperties()), JsonObject.class));
+            }
+            resourcesProp.add(type.getValue(), resourcesPropByType);
+        }
+        modelProperties.add("resourceDetails", resourcesProp);
+        return modelProperties;
+    }
+
+    private JsonObject getAllBlueprintParametersInJson(BlueprintArtifact blueprintArtifact) {
+        JsonObject node = new JsonObject();
+        Yaml yaml = new Yaml();
+        Map<String, Object> inputsNodes = ((Map<String, Object>) ((Map<String, Object>) yaml
+            .load(blueprintArtifact.getDcaeBlueprint())).get("inputs"));
+        inputsNodes.entrySet().stream().filter(e -> !e.getKey().contains("policy_id")).forEach(elem -> {
+            Object defaultValue = ((Map<String, Object>) elem.getValue()).get("default");
+            if (defaultValue != null) {
+                addPropertyToNode(node, elem.getKey(), defaultValue);
+            } else {
+                node.addProperty(elem.getKey(), "");
+            }
+        });
+        node.addProperty("policy_id", "AUTO_GENERATED_POLICY_ID_AT_SUBMIT");
+        return node;
+    }
+
+    /**
+     * ll get the latest version of the artifact (version can be specified to DCAE
+     * call)
+     *
+     * @return The DcaeInventoryResponse object containing the dcae values
+     */
+    private DcaeInventoryResponse queryDcaeToGetServiceTypeId(BlueprintArtifact blueprintArtifact)
+        throws IOException, ParseException, InterruptedException {
+        return dcaeInventoryService.getDcaeInformation(blueprintArtifact.getBlueprintArtifactName(),
+            blueprintArtifact.getBlueprintInvariantServiceUuid(),
+            blueprintArtifact.getResourceAttached().getResourceInvariantUUID());
+    }
+
+    private void addPropertyToNode(JsonObject node, String key, Object value) {
+        if (value instanceof String) {
+            node.addProperty(key, (String) value);
+        } else if (value instanceof Number) {
+            node.addProperty(key, (Number) value);
+        } else if (value instanceof Boolean) {
+            node.addProperty(key, (Boolean) value);
+        } else if (value instanceof Character) {
+            node.addProperty(key, (Character) value);
+        } else {
+            node.addProperty(key, JsonUtils.GSON.toJson(value));
+        }
+    }
+}
diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java
index 910c5aa..cc7f180 100644
--- a/src/main/java/org/onap/clamp/loop/Loop.java
+++ b/src/main/java/org/onap/clamp/loop/Loop.java
@@ -46,10 +46,10 @@
 import org.hibernate.annotations.Type;
 import org.hibernate.annotations.TypeDef;
 import org.hibernate.annotations.TypeDefs;
+import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
 import org.onap.clamp.loop.log.LoopLog;
 import org.onap.clamp.policy.microservice.MicroServicePolicy;
 import org.onap.clamp.policy.operational.OperationalPolicy;
-import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
 
 @Entity
 @Table(name = "loops")
@@ -86,6 +86,11 @@
     @Column(columnDefinition = "json", name = "global_properties_json")
     private JsonObject globalPropertiesJson;
 
+    @Expose
+    @Type(type = "json")
+    @Column(columnDefinition = "json", name = "model_properties_json")
+    private JsonObject modelPropertiesJson;
+
     @Column(nullable = false, name = "blueprint_yaml")
     private String blueprint;
 
@@ -213,14 +218,29 @@
         log.setLoop(this);
     }
 
-    public String getDcaeBlueprintId() {
+    String getDcaeBlueprintId() {
         return dcaeBlueprintId;
     }
 
-    public void setDcaeBlueprintId(String dcaeBlueprintId) {
+    void setDcaeBlueprintId(String dcaeBlueprintId) {
         this.dcaeBlueprintId = dcaeBlueprintId;
     }
 
+    JsonObject getModelPropertiesJson() {
+        return modelPropertiesJson;
+    }
+
+    void setModelPropertiesJson(JsonObject modelPropertiesJson) {
+        this.modelPropertiesJson = modelPropertiesJson;
+    }
+
+    public static String generateLoopName(String serviceName, String serviceVersion, String resourceName,
+        String blueprintFilename) {
+        StringBuilder buffer = new StringBuilder("LOOP_").append(serviceName).append("_v").append(serviceVersion)
+            .append("_").append(resourceName).append("_").append(blueprintFilename.replaceAll(".yaml", ""));
+        return buffer.toString().replace('.', '_').replaceAll(" ", "");
+    }
+
     @Override
     public int hashCode() {
         final int prime = 31;
diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java
index 13ba1a9..c104b13 100644
--- a/src/main/java/org/onap/clamp/policy/Policy.java
+++ b/src/main/java/org/onap/clamp/policy/Policy.java
@@ -21,7 +21,6 @@
  *
  */
 
-
 package org.onap.clamp.policy;
 
 import com.google.gson.JsonObject;
@@ -32,4 +31,12 @@
 
     JsonObject getJsonRepresentation();
 
+    static String generatePolicyName(String policyType, String serviceName, String serviceVersion, String resourceName,
+        String blueprintFilename) {
+        StringBuilder buffer = new StringBuilder(policyType).append("_").append(serviceName).append("_v")
+            .append(serviceVersion).append("_").append(resourceName).append("_")
+            .append(blueprintFilename.replaceAll(".yaml", ""));
+        return buffer.toString().replace('.', '_').replaceAll(" ", "");
+    }
+
 }
diff --git a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java b/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
index 8fd817c..9b83e72 100644
--- a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
@@ -25,6 +25,7 @@
 import static org.junit.Assert.fail;
 
 import com.google.gson.JsonSyntaxException;
+
 import java.io.IOException;
 import java.util.Map;
 
@@ -35,6 +36,7 @@
 import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.util.ReflectionTestUtils;
 
@@ -43,6 +45,7 @@
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest
+@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller")
 public class SdcControllersConfigurationItCase {
 
     @Autowired
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
index c6dbce4..58b922e 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
@@ -41,10 +41,12 @@
 import org.onap.sdc.api.notification.IResourceInstance;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
+@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller")
 public class SdcSingleControllerItCase {
 
     private static final String SDC_FOLDER = "/tmp/csar-handler-tests";
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
index 0df2523..ce8a493 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
@@ -60,10 +60,12 @@
 import org.skyscreamer.jsonassert.JSONAssert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
+@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller")
 public class CsarInstallerItCase {
 
     private static final String CSAR_ARTIFACT_NAME = "testArtifact.csar";
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
new file mode 100644
index 0000000..6bfee4c
--- /dev/null
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -0,0 +1,152 @@
+/*-
+ * ============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.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.json.JSONException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.clamp.clds.Application;
+import org.onap.clamp.clds.exception.policy.PolicyModelException;
+import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
+import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
+import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
+import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
+import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
+import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.sdc.api.notification.INotificationData;
+import org.onap.sdc.api.notification.IResourceInstance;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller-new")
+public class CsarInstallerItCase {
+
+    private static final String CSAR_ARTIFACT_NAME = "testArtifact.csar";
+    private static final String INVARIANT_SERVICE_UUID = "4cc5b45a-1f63-4194-8100-cd8e14248c92";
+    private static final String INVARIANT_RESOURCE1_UUID = "07e266fc-49ab-4cd7-8378-ca4676f1b9ec";
+    private static final String INVARIANT_RESOURCE2_UUID = "023a3f0d-1161-45ff-b4cf-8918a8ccf3ad";
+    private static final String RESOURCE_INSTANCE_NAME_RESOURCE1 = "ResourceInstanceName1";
+    private static final String RESOURCE_INSTANCE_NAME_RESOURCE2 = "ResourceInstanceName2";
+
+    @Autowired
+    private CsarInstaller csarInstaller;
+
+    private BlueprintArtifact buildFakeBuildprintArtifact(String instanceName, String invariantResourceUuid,
+        String blueprintFilePath, String artifactName, String invariantServiceUuid) throws IOException {
+        IResourceInstance resource = Mockito.mock(IResourceInstance.class);
+        Mockito.when(resource.getResourceInstanceName()).thenReturn(instanceName);
+        Mockito.when(resource.getResourceInvariantUUID()).thenReturn(invariantResourceUuid);
+        BlueprintArtifact blueprintArtifact = Mockito.mock(BlueprintArtifact.class);
+        Mockito.when(blueprintArtifact.getDcaeBlueprint())
+            .thenReturn(ResourceFileUtil.getResourceAsString(blueprintFilePath));
+        Mockito.when(blueprintArtifact.getBlueprintArtifactName()).thenReturn(artifactName);
+        Mockito.when(blueprintArtifact.getBlueprintInvariantServiceUuid()).thenReturn(invariantServiceUuid);
+        Mockito.when(blueprintArtifact.getResourceAttached()).thenReturn(resource);
+        return blueprintArtifact;
+    }
+
+    private CsarHandler buildFakeCsarHandler(String generatedName) throws IOException, SdcToscaParserException {
+        // Create fake notification
+        INotificationData notificationData = Mockito.mock(INotificationData.class);
+        Mockito.when(notificationData.getServiceVersion()).thenReturn("1.0");
+        // Create fake resource in notification
+        CsarHandler csarHandler = Mockito.mock(CsarHandler.class);
+        List<IResourceInstance> listResources = new ArrayList<>();
+        Mockito.when(notificationData.getResources()).thenReturn(listResources);
+        Map<String, BlueprintArtifact> blueprintMap = new HashMap<>();
+        Mockito.when(csarHandler.getMapOfBlueprints()).thenReturn(blueprintMap);
+        // Create fake blueprint artifact 1 on resource1
+        BlueprintArtifact blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1,
+            INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca.yaml", "tca.yaml", INVARIANT_SERVICE_UUID);
+        listResources.add(blueprintArtifact.getResourceAttached());
+        blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact);
+        // Create fake blueprint artifact 2 on resource2
+        blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE2, INVARIANT_RESOURCE2_UUID,
+            "example/sdc/blueprint-dcae/tca_2.yaml", "tca_2.yaml", INVARIANT_SERVICE_UUID);
+        listResources.add(blueprintArtifact.getResourceAttached());
+        blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact);
+
+        // Create fake blueprint artifact 3 on resource 1 so that it's possible to
+        // test multiple CL deployment per Service/vnf
+        blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, INVARIANT_RESOURCE1_UUID,
+            "example/sdc/blueprint-dcae/tca_3.yaml", "tca_3.yaml", INVARIANT_SERVICE_UUID);
+        blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact);
+
+        SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
+        ISdcCsarHelper sdcHelper = factory.getSdcCsarHelper(Thread.currentThread().getContextClassLoader()
+            .getResource("example/sdc/service-Simsfoimap0112.csar").getFile());
+
+        // Build fake csarhandler
+        Mockito.when(csarHandler.getSdcNotification()).thenReturn(notificationData);
+        // Build fake csar Helper
+        ISdcCsarHelper csarHelper = Mockito.mock(ISdcCsarHelper.class);
+        Metadata data = Mockito.mock(Metadata.class);
+        Mockito.when(data.getValue("name")).thenReturn(generatedName);
+        Mockito.when(notificationData.getServiceName()).thenReturn(generatedName);
+        Mockito.when(csarHelper.getServiceMetadata()).thenReturn(data);
+        Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(sdcHelper);
+        // Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(csarHelper);
+        Mockito.when(csarHandler.getPolicyModelYaml()).thenReturn(Optional.ofNullable(""));
+        return csarHandler;
+    }
+
+    public void testIsCsarAlreadyDeployedTca() throws SdcArtifactInstallerException, SdcToscaParserException,
+        CsarHandlerException, IOException, InterruptedException, PolicyModelException {
+        String generatedName = RandomStringUtils.randomAlphanumeric(5);
+        CsarHandler csarHandler = buildFakeCsarHandler(generatedName);
+        assertFalse(csarInstaller.isCsarAlreadyDeployed(csarHandler));
+        csarInstaller.installTheCsar(csarHandler);
+        assertTrue(csarInstaller.isCsarAlreadyDeployed(csarHandler));
+    }
+
+    @Test
+    public void testInstallTheCsarTca() throws SdcArtifactInstallerException, SdcToscaParserException,
+        CsarHandlerException, IOException, JSONException, InterruptedException, PolicyModelException {
+        String generatedName = RandomStringUtils.randomAlphanumeric(5);
+        CsarHandler csar = buildFakeCsarHandler(generatedName);
+        csarInstaller.installTheCsar(csar);
+
+    }
+
+}
diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties
index 49ed897..e15b873 100644
--- a/src/test/resources/application.properties
+++ b/src/test/resources/application.properties
@@ -62,7 +62,7 @@
 
 server.servlet.context-path=/
 #Modified engine-rest applicationpath
-spring.profiles.active=clamp-default,clamp-default-user,clamp-sdc-controller
+spring.profiles.active=clamp-default,clamp-default-user
 spring.http.converters.preferred-json-mapper=gson
 
 #The max number of active threads in this pool
