diff --git a/src/main/java/org/onap/clamp/clds/client/CdsServices.java b/src/main/java/org/onap/clamp/clds/client/CdsServices.java
index b8eb419..fa15e27 100644
--- a/src/main/java/org/onap/clamp/clds/client/CdsServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/CdsServices.java
@@ -84,8 +84,11 @@
             Date startTime = new Date();
             LoggingUtils.setTimeContext(startTime, new Date());
             return JsonUtils.GSON_JPA_MODEL.fromJson(cdsResponse, CdsBpWorkFlowListResponse.class);
+        } else {
+            logger.error("CDS getBlueprintWorkflowList FAILED");
+            return null;
         }
-        return null;
+
     }
 
     /**
@@ -114,8 +117,10 @@
             Date startTime = new Date();
             LoggingUtils.setTimeContext(startTime, new Date());
             return parseCdsResponse(cdsResponse);
+        } else {
+            logger.error("CDS getWorkflowInputProperties FAILED");
+            return null;
         }
-        return null;
     }
 
     protected JsonObject parseCdsResponse(String response) {
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java
index c92cad1..94a477f 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java
@@ -28,23 +28,16 @@
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
-
 import java.util.Map;
 import java.util.Set;
-
 import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess;
 import org.onap.clamp.loop.service.Service;
-import org.onap.clamp.tosca.DictionaryService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model.
  */
 public class ToscaMetadataCdsProcess extends ToscaMetadataProcess {
 
-    @Autowired
-    private DictionaryService dictionaryService;
-
     @Override
     public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) {
         switch (parameters) {
@@ -59,6 +52,7 @@
             case "operation":
                 generateOperation(childObject, serviceModel);
                 break;
+            default:
         }
     }
 
@@ -83,7 +77,7 @@
                 .entrySet()) {
             JsonObject controllerProperties = entry.getValue().getAsJsonObject()
                     .getAsJsonObject("controllerProperties");
-            if (controllerProperties != null) {
+            if (controllerProperties != null && controllerProperties.getAsJsonObject("workflows") != null) {
                 for (String workflowsEntry : controllerProperties.getAsJsonObject("workflows").keySet()) {
                     schemaEnum.add(workflowsEntry);
                     schemaTitle.add(workflowsEntry + " (CDS operation)");
@@ -107,7 +101,7 @@
                 .entrySet()) {
             JsonObject controllerProperties = entry.getValue().getAsJsonObject()
                     .getAsJsonObject("controllerProperties");
-            if (controllerProperties != null) {
+            if (controllerProperties != null && controllerProperties.getAsJsonObject("workflows") != null) {
                 for (Map.Entry<String, JsonElement> workflowsEntry : controllerProperties.getAsJsonObject("workflows")
                         .entrySet()) {
                     JsonObject obj = new JsonObject();
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstaller.java b/src/main/java/org/onap/clamp/loop/CsarInstaller.java
index b5ebdb9..67c7ce5 100644
--- a/src/main/java/org/onap/clamp/loop/CsarInstaller.java
+++ b/src/main/java/org/onap/clamp/loop/CsarInstaller.java
@@ -40,6 +40,7 @@
 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.loop.cds.CdsDataInstaller;
 import org.onap.clamp.loop.service.CsarServiceInstaller;
 import org.onap.clamp.loop.service.Service;
 import org.onap.clamp.loop.template.LoopElementModel;
@@ -79,6 +80,9 @@
     private CsarServiceInstaller csarServiceInstaller;
 
     @Autowired
+    private CdsDataInstaller cdsDataInstaller;
+
+    @Autowired
     private PolicyEngineServices policyEngineServices;
 
     /**
@@ -113,7 +117,10 @@
     public void installTheCsar(CsarHandler csar)
             throws SdcArtifactInstallerException, InterruptedException, BlueprintParserException {
         logger.info("Installing the CSAR " + csar.getFilePath());
-        installTheLoopTemplates(csar, csarServiceInstaller.installTheService(csar));
+        Service associatedService = csarServiceInstaller.installTheService(csar);
+        cdsDataInstaller.installCdsServiceProperties(csar, associatedService);
+
+        installTheLoopTemplates(csar, associatedService);
         logger.info("Successfully installed the CSAR " + csar.getFilePath());
     }
 
diff --git a/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java b/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
new file mode 100644
index 0000000..9c1cd3b
--- /dev/null
+++ b/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
@@ -0,0 +1,167 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ *                             reserved.
+ *  * Modifications Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * ================================================================================
+ * 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.cds;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.gson.JsonObject;
+import org.onap.clamp.clds.client.CdsServices;
+import org.onap.clamp.clds.model.cds.CdsBpWorkFlowListResponse;
+import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
+import org.onap.clamp.loop.service.Service;
+import org.onap.clamp.loop.service.ServicesRepository;
+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.stereotype.Component;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * This class installs the cds data in the service model properties.
+ * This can be refreshed later on by clicking on the button refresh, when recomputing the json schema.
+ */
+@Component
+public class CdsDataInstaller {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(CdsDataInstaller.class);
+
+    @Autowired
+    CdsServices cdsServices;
+
+    @Autowired
+    ServicesRepository serviceRepository;
+
+    public static final String CONTROLLER_PROPERTIES = "controllerProperties";
+    public static final String SDNC_MODEL_NAME = "sdnc_model_name";
+    public static final String SDNC_MODEL_VERSION = "sdnc_model_version";
+
+    /**
+     * This method installs the service model properties for CDS in the service object given in input.
+     *
+     * @param csar    The csar from sdc
+     * @param service the service object already provisioned with csar data
+     */
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public Service installCdsServiceProperties(CsarHandler csar, Service service) {
+        // Iterate on all types defined in the tosca lib
+        for (SdcTypes type : SdcTypes.values()) {
+            JsonObject resourcesPropByType = service.getResourceByType(type.getValue());
+            // For each type, get the metadata of each nodetemplate
+            for (NodeTemplate nodeTemplate : csar.getSdcCsarHelper().getServiceNodeTemplateBySdcType(type)) {
+                // get cds artifact information and save in resources Prop
+                if (SdcTypes.PNF == type || SdcTypes.VF == type) {
+                    JsonObject controllerProperties = createCdsArtifactProperties(nodeTemplate.getPropertyValue(
+                            SDNC_MODEL_NAME).toString(),
+                            nodeTemplate.getPropertyValue(SDNC_MODEL_VERSION).toString());
+                    if (controllerProperties != null) {
+                        resourcesPropByType.getAsJsonObject(nodeTemplate.getName())
+                                .add(CONTROLLER_PROPERTIES, controllerProperties);
+                    }
+                }
+            }
+        }
+        serviceRepository.save(service);
+        logger.info("Successfully installed the CDS data in Service");
+        return service;
+    }
+
+    /**
+     * This method updates the service model properties for CDS in the service object given in input.
+     *
+     * @param service the service object already provisioned with csar data
+     */
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public Service updateCdsServiceProperties(Service service) {
+        // Iterate on all types defined in the tosca lib
+        for (SdcTypes type : SdcTypes.values()) {
+            JsonObject resourcesPropByType = service.getResourceByType(type.getValue());
+            for (String resourceName : resourcesPropByType.keySet()) {
+                // get cds artifact information and save in resources Prop
+                if ((SdcTypes.PNF == type || SdcTypes.VF == type) && resourcesPropByType.getAsJsonObject(resourceName)
+                        .getAsJsonObject(CONTROLLER_PROPERTIES) != null) {
+                    JsonObject controllerProperties =
+                            createCdsArtifactProperties(resourcesPropByType.getAsJsonObject(resourceName)
+                                            .getAsJsonObject(CONTROLLER_PROPERTIES).get(SDNC_MODEL_NAME)
+                                            .getAsString(),
+                                    resourcesPropByType.getAsJsonObject(resourceName)
+                                            .getAsJsonObject(CONTROLLER_PROPERTIES).get(SDNC_MODEL_VERSION)
+                                            .getAsString());
+                    if (controllerProperties != null) {
+                        resourcesPropByType.getAsJsonObject(resourceName)
+                                .add(CONTROLLER_PROPERTIES, controllerProperties);
+                    }
+                }
+            }
+        }
+        serviceRepository.save(service);
+        logger.info("Successfully updated the CDS data in Service");
+        return service;
+    }
+
+    /**
+     * Retrieve CDS artifacts information from node template and save in resource object.
+     *
+     * @param sdncModelName    sdnc model name
+     * @param sdncModelVersion sdnc model version
+     * @return Returns CDS artifacts information
+     */
+    private JsonObject createCdsArtifactProperties(String sdncModelName, String sdncModelVersion) {
+        if (sdncModelName != null && sdncModelVersion != null) {
+            JsonObject controllerProperties = new JsonObject();
+            controllerProperties.addProperty(SDNC_MODEL_NAME, sdncModelName);
+            controllerProperties.addProperty(SDNC_MODEL_VERSION, sdncModelVersion);
+
+            CdsBpWorkFlowListResponse response =
+                    queryCdsToGetWorkFlowList(sdncModelName, sdncModelVersion);
+            if (response == null) {
+                return controllerProperties;
+            }
+
+            JsonObject workFlowProps = new JsonObject();
+            for (String workFlow : response.getWorkflows()) {
+                logger.info("Found CDS workflow " + workFlow + " for model name " + sdncModelName + " and version "
+                        + sdncModelVersion);
+                JsonObject inputs = queryCdsToGetWorkFlowInputProperties(response.getBlueprintName(),
+                        response.getVersion(), workFlow);
+                workFlowProps.add(workFlow, inputs);
+            }
+
+            controllerProperties.add("workflows", workFlowProps);
+            return controllerProperties;
+        }
+        return null;
+    }
+
+
+    private CdsBpWorkFlowListResponse queryCdsToGetWorkFlowList(String artifactName, String artifactVersion) {
+        return cdsServices.getBlueprintWorkflowList(artifactName, artifactVersion);
+    }
+
+    private JsonObject queryCdsToGetWorkFlowInputProperties(String artifactName, String artifactVersion,
+                                                            String workFlow) {
+        return cdsServices.getWorkflowInputProperties(artifactName, artifactVersion, workFlow);
+    }
+}
diff --git a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
index 6db6d92..c43f2cb 100644
--- a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
+++ b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
@@ -28,9 +28,7 @@
 import com.att.eelf.configuration.EELFManager;
 import com.google.gson.JsonObject;
 import java.util.Map.Entry;
-import org.onap.clamp.clds.client.CdsServices;
 import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
-import org.onap.clamp.clds.model.cds.CdsBpWorkFlowListResponse;
 import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
 import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.sdc.tosca.parser.api.IEntityDetails;
@@ -54,9 +52,6 @@
     @Autowired
     ServicesRepository serviceRepository;
 
-    @Autowired
-    CdsServices cdsServices;
-
     /**
      * Install the Service from the csar.
      *
@@ -90,14 +85,6 @@
             for (NodeTemplate nodeTemplate : csar.getSdcCsarHelper().getServiceNodeTemplateBySdcType(type)) {
                 resourcesPropByType.add(nodeTemplate.getName(),
                         JsonUtils.GSON.toJsonTree(nodeTemplate.getMetaData().getAllProperties()));
-                // get cds artifact information and save in resources Prop
-                if (SdcTypes.PNF == type || SdcTypes.VF == type) {
-                    JsonObject controllerProperties = createCdsArtifactProperties(nodeTemplate);
-                    if (controllerProperties != null) {
-                        resourcesPropByType.getAsJsonObject(nodeTemplate.getName())
-                                .add("controllerProperties", controllerProperties);
-                    }
-                }
             }
             resourcesProp.add(type.getValue(), resourcesPropByType);
         }
@@ -139,45 +126,4 @@
 
         return alreadyInstalled;
     }
-
-    /**
-     * Retrive CDS artifacts information from node template and save in resource object.
-     *
-     * @param nodeTemplate node template
-     * @return Returns CDS artifacts information
-     */
-    private JsonObject createCdsArtifactProperties(NodeTemplate nodeTemplate) {
-        Object artifactName = nodeTemplate.getPropertyValue("sdnc_model_name");
-        Object artifactVersion = nodeTemplate.getPropertyValue("sdnc_model_version");
-        if (artifactName != null && artifactVersion != null) {
-            CdsBpWorkFlowListResponse response =
-                    queryCdsToGetWorkFlowList(artifactName.toString(), artifactVersion.toString());
-            if (response == null) {
-                return null;
-            }
-
-            JsonObject workFlowProps = new JsonObject();
-            for (String workFlow : response.getWorkflows()) {
-                JsonObject inputs = queryCdsToGetWorkFlowInputProperties(response.getBlueprintName(),
-                        response.getVersion(), workFlow);
-                workFlowProps.add(workFlow, inputs);
-            }
-
-            JsonObject controllerProperties = new JsonObject();
-            controllerProperties.addProperty("sdnc_model_name", artifactName.toString());
-            controllerProperties.addProperty("sdnc_model_version", artifactVersion.toString());
-            controllerProperties.add("workflows", workFlowProps);
-            return controllerProperties;
-        }
-        return null;
-    }
-
-    private CdsBpWorkFlowListResponse queryCdsToGetWorkFlowList(String artifactName, String artifactVersion) {
-        return cdsServices.getBlueprintWorkflowList(artifactName, artifactVersion);
-    }
-
-    private JsonObject queryCdsToGetWorkFlowInputProperties(String artifactName, String artifactVersion,
-                                                            String workFlow) {
-        return cdsServices.getWorkflowInputProperties(artifactName, artifactVersion, workFlow);
-    }
 }
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 674db22..690b7ae 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -208,7 +208,7 @@
             JsonObject controllerProperties = entry.getValue().getAsJsonObject()
                     .getAsJsonObject("controllerProperties");
 
-            if (controllerProperties != null) {
+            if (controllerProperties != null && controllerProperties.getAsJsonObject("workflows") != null) {
                 JsonObject workflows = controllerProperties.getAsJsonObject("workflows");
                 for (Entry<String, JsonElement> workflowsEntry : workflows.entrySet()) {
                     JsonObject obj = new JsonObject();
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 88d5826..86a64f6 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -283,7 +283,9 @@
 							uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
 					<to uri="direct:load-loop" />
 					<to
-							uri="bean:org.onap.clamp.loop.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName}})" />
+							uri="bean:org.onap.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" />
+					<to
+							uri="bean:org.onap.clamp.loop.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName})" />
 					<log loggingLevel="INFO"
 						 message="REFRESH Micro Service policy request successfully executed for loop: ${header.loopName}" />
 					<to
@@ -324,7 +326,9 @@
 						uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
 					<to uri="direct:load-loop" />
 					<to
-						uri="bean:org.onap.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName}})" />
+							uri="bean:org.onap.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" />
+					<to
+						uri="bean:org.onap.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName})" />
 					<log loggingLevel="INFO"
 						message="REFRESH operational policy request successfully executed for loop: ${header.loopName}" />
 					<to
diff --git a/src/main/resources/clds/camel/routes/cds-flows.xml b/src/main/resources/clds/camel/routes/cds-flows.xml
index 5c10a0c..9946c99 100644
--- a/src/main/resources/clds/camel/routes/cds-flows.xml
+++ b/src/main/resources/clds/camel/routes/cds-flows.xml
@@ -15,6 +15,15 @@
                  message="Endpoint to query workflows from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}"></log>
             <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.cds.userName}}&amp;authPassword={{clamp.config.cds.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
             <convertBodyTo type="java.lang.String"/>
+            <doCatch>
+                <exception>java.lang.Exception</exception>
+                <handled>
+                    <constant>true</constant>
+                </handled>
+
+                <log loggingLevel="ERROR"
+                     message="GET CDS request FAILED: ${exception.stacktrace}" />
+            </doCatch>
             <doFinally>
                 <to uri="direct:reset-raise-http-exception-flag"/>
                 <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
@@ -37,6 +46,15 @@
                  message="Endpoint to query input properties for workflow from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec"></log>
             <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.cds.userName}}&amp;authPassword={{clamp.config.cds.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
             <convertBodyTo type="java.lang.String"/>
+            <doCatch>
+                <exception>java.lang.Exception</exception>
+                <handled>
+                    <constant>true</constant>
+                </handled>
+
+                <log loggingLevel="ERROR"
+                     message="GET CDS workflow input request FAILED: ${exception.stacktrace}" />
+            </doCatch>
             <doFinally>
                 <to uri="direct:reset-raise-http-exception-flag"/>
                 <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
diff --git a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java b/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
index ec39fc3..9fdc727 100644
--- a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
+++ b/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
@@ -23,9 +23,7 @@
 package org.onap.clamp.clds.client;
 
 import com.google.gson.JsonObject;
-
 import java.io.IOException;
-
 import org.junit.Test;
 import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index ac7b236..d149752 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -50,6 +50,7 @@
 import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
 import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.loop.cds.CdsDataInstaller;
 import org.onap.clamp.loop.service.ServicesRepository;
 import org.onap.clamp.loop.template.LoopTemplate;
 import org.onap.clamp.loop.template.LoopTemplateLoopElementModel;
@@ -180,8 +181,7 @@
         CsarHandler csarHandler = new CsarHandler(notificationData, "", "");
         csarHandler
                 .setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME).getFile());
-        Optional<String> testyaml = csarHandler.getPolicyModelYaml();
-        Assert.assertEquals(testyaml, Optional
+        Assert.assertEquals(csarHandler.getPolicyModelYaml(), Optional
                 .ofNullable(ResourceFileUtil.getResourceAsString("example/sdc/expected-result/policy-data.yaml")));
     }
 
@@ -205,6 +205,10 @@
         CsarHandler csar = buildFakeCsarHandler(generatedName);
         csarInstaller.installTheCsar(csar);
         assertThat(serviceRepository.existsById("63cac700-ab9a-4115-a74f-7eac85e3fce0")).isTrue();
+        // We should have CDS info
+        assertThat(serviceRepository.findById("63cac700-ab9a-4115-a74f-7eac85e3fce0").get().getResourceByType("VF")
+                .getAsJsonObject("vLoadBalancerMS 0").getAsJsonObject(
+                        CdsDataInstaller.CONTROLLER_PROPERTIES)).isNotNull();
         assertThat(loopTemplatesRepo.existsById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0",
                 RESOURCE_INSTANCE_NAME_RESOURCE1, "tca.yaml"))).isTrue();
         assertThat(loopTemplatesRepo.existsById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0",
diff --git a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java b/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
index a6a4968..b90a286 100644
--- a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
+++ b/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
@@ -55,12 +55,13 @@
         JsonObject jsonModel = new GsonBuilder().create()
                 .fromJson(ResourceFileUtil.getResourceAsString("tosca/model-properties-cds.json"), JsonObject.class);
         Service service = new Service(jsonModel.get("serviceDetails").getAsJsonObject(),
-                                      jsonModel.get("resourceDetails").getAsJsonObject(),
-                                      "1.0");
+                jsonModel.get("resourceDetails").getAsJsonObject(),
+                "1.0");
 
         JsonObject jsonSchema = OperationalPolicyRepresentationBuilder.generateOperationalPolicySchema(service);
         assertThat(jsonSchema).isNotNull();
-        JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/operational-policy-cds-payload-with-list.json"),
-                                new GsonBuilder().create().toJson(jsonSchema), false);
+        JSONAssert.assertEquals(
+                ResourceFileUtil.getResourceAsString("tosca/operational-policy-cds-payload-with-list.json"),
+                new GsonBuilder().create().toJson(jsonSchema), false);
     }
 }
