diff --git a/pom.xml b/pom.xml
index 297b0a1..6a2d273 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
 				<eelf.core.version>1.0.0</eelf.core.version>
 				<camel.version>2.22.1</camel.version>
 				<springboot.version>2.0.6.RELEASE</springboot.version>
-				
+
 				<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
 				<sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
 				<sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
@@ -75,7 +75,7 @@
 				<sonar.projectVersion>${project.version}</sonar.projectVersion>
 				<!-- Enable language to disable javascript analysis -->
 				<sonar.language>java</sonar.language>
-				<!-- Parameters for Javascript coverage 
+				<!-- Parameters for Javascript coverage
 					<sonar.sources>src/main,${project.build.directory}/clamp-ui/designer</sonar.sources>
 					<sonar.javascript.lcov.reportPaths>${project.build.directory}/clamp-ui/coverage/lcov.info</sonar.javascript.lcov.reportPaths>
 				 -->
@@ -265,7 +265,7 @@
 						<artifactId>camel-servlet-starter</artifactId>
 				</dependency>
 				<dependency>
-					<groupId>org.apache.camel</groupId> 
+					<groupId>org.apache.camel</groupId>
 					<artifactId>camel-jackson-starter</artifactId>
 				</dependency>
 				<dependency>
@@ -296,6 +296,12 @@
 				<dependency>
 						<groupId>org.springframework.boot</groupId>
 						<artifactId>spring-boot-starter-web</artifactId>
+						<exclusions>
+							<exclusion>
+								<groupId>org.springframework.boot</groupId>
+								<artifactId>spring-boot-starter-json</artifactId>
+								</exclusion>
+						</exclusions>
 				</dependency>
 				<dependency>
 						<groupId>org.springframework.boot</groupId>
@@ -438,6 +444,10 @@
 										<artifactId>integrity-audit</artifactId>
 								</exclusion>
 								<exclusion>
+									<groupId>com.fasterxml.jackson.core</groupId>
+									<artifactId>jackson-databind</artifactId>
+								</exclusion>
+								<exclusion>
 										<groupId>org.onap.aaf.cadi</groupId>
 										<artifactId>cadi-aaf</artifactId>
 								</exclusion>
@@ -567,6 +577,12 @@
 						<groupId>org.onap.sdc.sdc-tosca</groupId>
 						<artifactId>sdc-tosca</artifactId>
 						<version>1.4.1</version>
+						<exclusions>
+							<exclusion>
+								<groupId>com.fasterxml.jackson.core</groupId>
+								<artifactId>jackson-databind</artifactId>
+							</exclusion>
+						</exclusions>
 				</dependency>
 				<!-- TESTING -->
 				<dependency>
@@ -642,7 +658,7 @@
 						</testResource>
 				</testResources>
 				<resources>
-						<!--  For AAF folder maven should not try to filter Keystores/Truststores ... 
+						<!--  For AAF folder maven should not try to filter Keystores/Truststores ...
 							  Otherwise they will be broken and unreadable
 						-->
 						<resource>
@@ -701,8 +717,8 @@
 								</execution>
 							</executions>
 						</plugin>
-						<!-- Read the swagger.json file and the definition from SwaggerConfig.java; 
-							generate a list of .adoc files containing the APIs info in more structured 
+						<!-- Read the swagger.json file and the definition from SwaggerConfig.java;
+							generate a list of .adoc files containing the APIs info in more structured
 							way -->
 						<plugin>
 								<groupId>io.github.swagger2markup</groupId>
@@ -737,7 +753,7 @@
 								</executions>
 						</plugin>
 
-						<!-- Run the generated asciidoc through Asciidoctor to generate other 
+						<!-- Run the generated asciidoc through Asciidoctor to generate other
 								documentation types, such as PDFs or HTML5 -->
 						<plugin>
 								<groupId>org.asciidoctor</groupId>
@@ -1002,7 +1018,7 @@
 																		<tag>${project.docker.latesttagtimestamp.version}</tag>
 																		<tag>${project.docker.latesttag.version}</tag>
 																</tags>
-																<!-- A relative path is looked up in ${project.basedir}/src/main/docker 
+																<!-- A relative path is looked up in ${project.basedir}/src/main/docker
 																		by default -->
 																<dockerFile>Dockerfile</dockerFile>
 																<assembly>
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
index 4151c7a..6845452 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
@@ -25,9 +25,8 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import java.util.Date;
 
@@ -122,16 +121,16 @@
      *        The value for each blueprint parameters in a flat JSON
      * @return The status URL
      */
-    public String createNewDeployment(String deploymentId, String serviceTypeId, JsonNode blueprintInputJson) {
+    public String createNewDeployment(String deploymentId, String serviceTypeId, JsonObject blueprintInputJson) {
         Date startTime = new Date();
         LoggingUtils.setTargetContext("DCAE", "createNewDeployment");
         try {
-            ObjectNode rootNode = (ObjectNode) refProp.getJsonTemplate("dcae.deployment.template");
-            rootNode.put("serviceTypeId", serviceTypeId);
+            JsonObject rootObject = refProp.getJsonTemplate("dcae.deployment.template").getAsJsonObject();
+            rootObject.addProperty("serviceTypeId", serviceTypeId);
             if (blueprintInputJson != null) {
-                rootNode.set("inputs", blueprintInputJson);
+                rootObject.add("inputs", blueprintInputJson);
             }
-            String apiBodyString = rootNode.toString();
+            String apiBodyString = rootObject.toString();
             logger.info("Dcae api Body String - " + apiBodyString);
             String url = refProp.getStringValue(DCAE_URL_PROPERTY_NAME) + DCAE_URL_PREFIX + deploymentId;
             String statusUrl = getDcaeResponse(url, "PUT", apiBodyString, "application/json", DCAE_LINK_FIELD,
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
index 327aff1..7702307 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
@@ -44,7 +44,7 @@
 import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse;
 import org.onap.clamp.clds.model.properties.Global;
 import org.onap.clamp.clds.model.properties.ModelProperties;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -155,14 +155,13 @@
     }
 
     private DcaeInventoryResponse getItemsFromDcaeInventoryResponse(String responseStr)
-        throws ParseException, IOException {
+        throws ParseException {
         JSONParser parser = new JSONParser();
         Object obj0 = parser.parse(responseStr);
         JSONObject jsonObj = (JSONObject) obj0;
         JSONArray itemsArray = (JSONArray) jsonObj.get("items");
         JSONObject dcaeServiceType0 = (JSONObject) itemsArray.get(0);
-        return JacksonUtils.getObjectMapperInstance().readValue(dcaeServiceType0.toString(),
-            DcaeInventoryResponse.class);
+        return JsonUtils.GSON.fromJson(dcaeServiceType0.toString(), DcaeInventoryResponse.class);
     }
 
     /**
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
index cd7d4f2..37c6257 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
@@ -26,18 +26,19 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.fasterxml.jackson.databind.node.TextNode;
 
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import com.google.gson.reflect.TypeToken;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringReader;
+import java.lang.reflect.Type;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
@@ -68,7 +69,7 @@
 import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
 import org.onap.clamp.clds.service.CldsService;
 import org.onap.clamp.clds.util.CryptoUtils;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
@@ -80,17 +81,24 @@
 
     private static final EELFLogger logger = EELFManager.getInstance().getLogger(SdcCatalogServices.class);
     private static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
-    public static final String RESOURCE_VF_TYPE = "VF";
-    public static final String RESOURCE_VFC_TYPE = "VFC";
-    public static final String RESOURCE_CVFC_TYPE = "CVFC";
-    public static final String SDC_REQUESTID_PROPERTY_NAME = "sdc.header.requestId";
-    public static final String SDC_METADATA_URL_PREFIX = "/metadata";
-    public static final String SDC_INSTANCE_ID_PROPERTY_NAME = "sdc.InstanceID";
-    public static final String SDC_CATALOG_URL_PROPERTY_NAME = "sdc.catalog.url";
-    public static final String SDC_SERVICE_URL_PROPERTY_NAME = "sdc.serviceUrl";
-    public static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";
-    public static final String RESOURCE_URL_PREFIX = "resources";
+    private static final String RESOURCE_VF_TYPE = "VF";
+    private static final String RESOURCE_VFC_TYPE = "VFC";
+    private static final String RESOURCE_CVFC_TYPE = "CVFC";
+    private static final String SDC_REQUESTID_PROPERTY_NAME = "sdc.header.requestId";
+    private static final String SDC_METADATA_URL_PREFIX = "/metadata";
+    private static final String SDC_INSTANCE_ID_PROPERTY_NAME = "sdc.InstanceID";
+    private static final String SDC_CATALOG_URL_PROPERTY_NAME = "sdc.catalog.url";
+    private static final String SDC_SERVICE_URL_PROPERTY_NAME = "sdc.serviceUrl";
+    private static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";
+    private static final String RESOURCE_URL_PREFIX = "resources";
     private static final LoggingUtils utils = new LoggingUtils(logger);
+
+    private static final Type LIST_SDC_SERVICE_INFO_TYPE = new TypeToken<List<SdcServiceInfo>>() {
+    }.getType();
+
+    private static final Type LIST_SDC_RESOURCE_BASIC_INFO_TYPE = new TypeToken<List<SdcResourceBasicInfo>>() {
+    }.getType();
+
     @Autowired
     private ClampProperties refProp;
 
@@ -285,9 +293,8 @@
             return new ArrayList<>();
         }
         try {
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, JacksonUtils.getObjectMapperInstance()
-                .getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));
-        } catch (IOException e) {
+            return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_SERVICE_INFO_TYPE);
+        } catch (JsonParseException e) {
             logger.error("Error when attempting to decode the JSON containing CldsSdcServiceInfo", e);
             return new ArrayList<>();
         }
@@ -305,9 +312,8 @@
             return new ArrayList<>();
         }
         try {
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, JacksonUtils.getObjectMapperInstance()
-                .getTypeFactory().constructCollectionType(List.class, SdcResourceBasicInfo.class));
-        } catch (IOException e) {
+            return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_RESOURCE_BASIC_INFO_TYPE);
+        } catch (JsonParseException e) {
             logger.error("Exception occurred when attempting to decode the list of CldsSdcResourceBasicInfo JSON", e);
             return new ArrayList<>();
         }
@@ -321,8 +327,8 @@
      */
     public SdcServiceDetail decodeCldsSdcServiceDetailFromJson(String jsonStr) {
         try {
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, SdcServiceDetail.class);
-        } catch (IOException e) {
+            return JsonUtils.GSON.fromJson(jsonStr, SdcServiceDetail.class);
+        } catch (JsonParseException e) {
             logger.error("Exception when attempting to decode the CldsSdcServiceDetail JSON", e);
             return null;
         }
@@ -402,9 +408,8 @@
         if (responseStr != null) {
             SdcServiceDetail cldsSdcServiceDetail;
             try {
-                cldsSdcServiceDetail = JacksonUtils.getObjectMapperInstance().readValue(responseStr,
-                    SdcServiceDetail.class);
-            } catch (IOException e) {
+                cldsSdcServiceDetail = JsonUtils.GSON.fromJson(responseStr, SdcServiceDetail.class);
+            } catch (JsonParseException e) {
                 logger.error("Exception when decoding the CldsServiceData JSON from SDC", e);
                 throw new SdcCommunicationException("Exception when decoding the CldsServiceData JSON from SDC", e);
             }
@@ -497,41 +502,43 @@
     }
 
     private List<CldsVfcData> getVfcDataListFromVfResponse(String vfResponse) {
-        ObjectNode vfResponseNode;
+        JsonObject vfResponseNode;
         try {
-            vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfResponse);
-        } catch (IOException e) {
+            vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);
+        } catch (JsonParseException e) {
             logger.error("Exception when decoding the JSON list of CldsVfcData", e);
             return new ArrayList<>();
         }
-        ArrayNode vfcArrayNode = (ArrayNode) vfResponseNode.get("resources");
+        JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();
         List<CldsVfcData> cldsVfcDataList = new ArrayList<>();
         if (vfcArrayNode != null) {
-            for (JsonNode vfcjsonNode : vfcArrayNode) {
-                ObjectNode currVfcNode = (ObjectNode) vfcjsonNode;
-                TextNode resourceTypeNode = (TextNode) currVfcNode.get("resoucreType");
-                if (resourceTypeNode != null && "VFC".equalsIgnoreCase(resourceTypeNode.textValue())) {
-                    handleVFCtypeNode(currVfcNode, cldsVfcDataList);
-                } else if (resourceTypeNode != null && "CVFC".equalsIgnoreCase(resourceTypeNode.textValue())) {
-                    handleCVFCtypeNode(currVfcNode, cldsVfcDataList);
+            for (JsonElement vfcjsonNode : vfcArrayNode) {
+                JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();
+                JsonElement resourceTypeNode = currVfcNode.get("resoucreType");
+                if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive()) {
+                    if ("VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
+                        handleVFCtypeNode(currVfcNode, cldsVfcDataList);
+                    } else if ("CVFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
+                        handleCVFCtypeNode(currVfcNode, cldsVfcDataList);
+                    }
                 }
             }
         }
         return cldsVfcDataList;
     }
 
-    private void handleVFCtypeNode(ObjectNode currVfcNode, List<CldsVfcData> cldsVfcDataList) {
+    private void handleVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {
         CldsVfcData currCldsVfcData = new CldsVfcData();
-        TextNode vfcResourceName = (TextNode) currVfcNode.get("resourceInstanceName");
-        TextNode vfcInvariantResourceUuid = (TextNode) currVfcNode.get("resourceInvariantUUID");
-        currCldsVfcData.setVfcName(vfcResourceName.textValue());
-        currCldsVfcData.setVfcInvariantResourceUUID(vfcInvariantResourceUuid.textValue());
+        String vfcResourceName = currVfcNode.get("resourceInstanceName").getAsString();
+        String vfcInvariantResourceUuid = currVfcNode.get("resourceInvariantUUID").getAsString();
+        currCldsVfcData.setVfcName(vfcResourceName);
+        currCldsVfcData.setVfcInvariantResourceUUID(vfcInvariantResourceUuid);
         cldsVfcDataList.add(currCldsVfcData);
     }
 
-    private void handleCVFCtypeNode(ObjectNode currVfcNode, List<CldsVfcData> cldsVfcDataList) {
+    private void handleCVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {
         handleVFCtypeNode(currVfcNode, cldsVfcDataList);
-        cldsVfcDataList.addAll(getVFCfromCVFC(currVfcNode.get("resourceUUID").textValue()));
+        cldsVfcDataList.addAll(getVFCfromCVFC(currVfcNode.get("resourceUUID").getAsString()));
     }
 
     private List<CldsVfcData> getVFCfromCVFC(String resourceUUID) {
@@ -541,18 +548,18 @@
             String vfcResourceUUIDUrl = catalogUrl + RESOURCE_URL_PREFIX + "/" + resourceUUID + SDC_METADATA_URL_PREFIX;
             try {
                 String vfcResponse = getCldsServicesOrResourcesBasedOnURL(vfcResourceUUIDUrl);
-                ObjectNode vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfcResponse);
-                ArrayNode vfcArrayNode = (ArrayNode) vfResponseNode.get("resources");
+                JsonObject vfResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);
+                JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();
                 if (vfcArrayNode != null) {
-                    for (JsonNode vfcjsonNode : vfcArrayNode) {
-                        ObjectNode currVfcNode = (ObjectNode) vfcjsonNode;
-                        TextNode resourceTypeNode = (TextNode) currVfcNode.get("resoucreType");
-                        if (resourceTypeNode != null && "VFC".equalsIgnoreCase(resourceTypeNode.textValue())) {
+                    for (JsonElement vfcjsonNode : vfcArrayNode) {
+                        JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();
+                        JsonElement resourceTypeNode = currVfcNode.get("resoucreType");
+                        if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive() && "VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {
                             handleVFCtypeNode(currVfcNode, cldsVfcDataList);
                         }
                     }
                 }
-            } catch (IOException e) {
+            } catch (JsonParseException e) {
                 logger.error("Exception during JSON analyzis", e);
             }
         }
@@ -565,20 +572,21 @@
 
     private List<CldsAlarmCondition> getAlarmCondtionsFromVfc(String vfcResponse) throws GeneralSecurityException {
         List<CldsAlarmCondition> cldsAlarmConditionList = new ArrayList<>();
-        ObjectNode vfcResponseNode;
+        JsonObject vfcResponseNode;
         try {
-            vfcResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfcResponse);
-        } catch (IOException e) {
+            vfcResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);
+        } catch (JsonParseException e) {
             logger.error("Exception when decoding the JSON list of CldsAlarmCondition", e);
             return cldsAlarmConditionList;
         }
-        ArrayNode artifactsArrayNode = (ArrayNode) vfcResponseNode.get("artifacts");
-        if (artifactsArrayNode != null && artifactsArrayNode.size() > 0) {
-            for (int index = 0; index < artifactsArrayNode.size(); index++) {
-                ObjectNode currArtifactNode = (ObjectNode) artifactsArrayNode.get(index);
-                TextNode artifactUrlNode = (TextNode) currArtifactNode.get("artifactURL");
-                if (artifactUrlNode != null) {
-                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.textValue());
+        JsonElement artifactsNode = vfcResponseNode.get("artifacts");
+        if (artifactsNode != null && artifactsNode.isJsonArray() && artifactsNode.getAsJsonArray().size() > 0) {
+            JsonArray artifactsList = artifactsNode.getAsJsonArray();
+            for (int index = 0; index < artifactsList.size(); index++) {
+                JsonObject currArtifactNode = artifactsList.get(index).getAsJsonObject();
+                JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");
+                if (artifactUrlNode != null && artifactUrlNode.isJsonPrimitive()) {
+                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());
                     cldsAlarmConditionList.addAll(parseCsvToGetAlarmConditions(responsesFromArtifactUrl));
                     logger.info(responsesFromArtifactUrl);
                 }
@@ -609,26 +617,26 @@
     // Method to get the artifact for any particular VF
     private List<CldsVfKPIData> getFieldPathFromVF(String vfResponse) throws GeneralSecurityException {
         List<CldsVfKPIData> cldsVfKPIDataList = new ArrayList<>();
-        ObjectNode vfResponseNode;
+        JsonObject vfResponseNode;
         try {
-            vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfResponse);
-        } catch (IOException e) {
+            vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);
+        } catch (JsonParseException e) {
             logger.error("Exception when decoding the JSON list of CldsVfKPIData", e);
             return cldsVfKPIDataList;
         }
-        ArrayNode artifactsArrayNode = (ArrayNode) vfResponseNode.get("artifacts");
+        JsonArray artifactsArrayNode = vfResponseNode.get("artifacts").getAsJsonArray();
         if (artifactsArrayNode != null && artifactsArrayNode.size() > 0) {
             for (int index = 0; index < artifactsArrayNode.size(); index++) {
-                ObjectNode currArtifactNode = (ObjectNode) artifactsArrayNode.get(index);
-                TextNode artifactUrlNode = (TextNode) currArtifactNode.get("artifactURL");
-                TextNode artifactNameNode = (TextNode) currArtifactNode.get("artifactName");
+                JsonObject currArtifactNode = artifactsArrayNode.get(index).getAsJsonObject();
+                JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");
+                JsonElement artifactNameNode = currArtifactNode.get("artifactName");
                 String artifactName = "";
                 if (artifactNameNode != null) {
-                    artifactName = artifactNameNode.textValue();
+                    artifactName = artifactNameNode.getAsString();
                     artifactName = artifactName.substring(artifactName.lastIndexOf('.') + 1);
                 }
                 if (artifactUrlNode != null && "csv".equalsIgnoreCase(artifactName)) {
-                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.textValue());
+                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());
                     cldsVfKPIDataList.addAll(parseCsvToGetFieldPath(responsesFromArtifactUrl));
                     logger.info(responsesFromArtifactUrl);
                 }
@@ -760,37 +768,32 @@
     /**
      * To create properties object by using cldsServicedata.
      *
-     * @param globalProps
-     * @param cldsServiceData
-     * @return
-     * @throws IOException
-     *         In case of issues during the parsing of the Global Properties
+     * @throws IOException In case of issues during the parsing of the Global Properties
      */
     public String createPropertiesObjectByUUID(CldsServiceData cldsServiceData) throws IOException {
         String totalPropsStr;
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
-        ObjectNode globalPropsJson = (ObjectNode) refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY);
+        JsonObject globalPropsJson = refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY).getAsJsonObject();
         if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {
             // Objectnode to save all byservice, byvf , byvfc and byalarm nodes
-            ObjectNode byIdObjectNode = mapper.createObjectNode();
+            JsonObject byIdObjectNode = new JsonObject();
             // To create vf ResourceUUID node with serviceInvariantUUID
-            ObjectNode invariantUuidObjectNodeWithVf = createVfObjectNodeByServiceInvariantUuid(cldsServiceData);
-            byIdObjectNode.putPOJO("byService", invariantUuidObjectNodeWithVf);
+            JsonObject invariantUuidObjectNodeWithVf = createVfObjectNodeByServiceInvariantUuid(cldsServiceData);
+            byIdObjectNode.add("byService", invariantUuidObjectNodeWithVf);
             // To create byVf and vfcResourceNode with vfResourceUUID
-            ObjectNode vfcObjectNodeByVfUuid = createVfcObjectNodeByVfUuid(cldsServiceData.getCldsVfs());
-            byIdObjectNode.putPOJO("byVf", vfcObjectNodeByVfUuid);
+            JsonObject vfcObjectNodeByVfUuid = createVfcObjectNodeByVfUuid(cldsServiceData.getCldsVfs());
+            byIdObjectNode.add("byVf", vfcObjectNodeByVfUuid);
             // To create byKpi
-            ObjectNode kpiObjectNode = mapper.createObjectNode();
+            JsonObject kpiJsonObject = new JsonObject();
             if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {
                 for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {
                     if (currCldsVfData != null) {
-                        createKpiObjectNodeByVfUuid(kpiObjectNode, currCldsVfData.getCldsKPIList());
+                        createKpiObjectNodeByVfUuid(kpiJsonObject, currCldsVfData.getCldsKPIList());
                     }
                 }
             }
-            byIdObjectNode.putPOJO("byKpi", kpiObjectNode);
+            byIdObjectNode.add("byKpi", kpiJsonObject);
             // To create byVfc and alarmCondition with vfcResourceUUID
-            ObjectNode vfcResourceUuidObjectNode = mapper.createObjectNode();
+            JsonObject vfcResourceUuidObjectNode = new JsonObject();
             if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {
                 for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {
                     if (currCldsVfData != null) {
@@ -798,18 +801,18 @@
                     }
                 }
             }
-            byIdObjectNode.putPOJO("byVfc", vfcResourceUuidObjectNode);
+            byIdObjectNode.add("byVfc", vfcResourceUuidObjectNode);
             // To create byAlarmCondition with alarmConditionKey
             List<CldsAlarmCondition> allAlarmConditions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,
                 "alarmCondition");
-            ObjectNode alarmCondObjectNodeByAlarmKey = createAlarmCondObjectNodeByAlarmKey(allAlarmConditions);
-            byIdObjectNode.putPOJO("byAlarmCondition", alarmCondObjectNodeByAlarmKey);
+            JsonObject alarmCondObjectNodeByAlarmKey = createAlarmCondObjectNodeByAlarmKey(allAlarmConditions);
+            byIdObjectNode.add("byAlarmCondition", alarmCondObjectNodeByAlarmKey);
             // To create byAlertDescription with AlertDescription
             List<CldsAlarmCondition> allAlertDescriptions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,
                 "alertDescription");
-            ObjectNode alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(allAlertDescriptions);
-            byIdObjectNode.putPOJO("byAlertDescription", alertDescObjectNodeByAlert);
-            globalPropsJson.putPOJO("shared", byIdObjectNode);
+            JsonObject alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(allAlertDescriptions);
+            byIdObjectNode.add("byAlertDescription", alertDescObjectNodeByAlert);
+            globalPropsJson.add("shared", byIdObjectNode);
             logger.info("Global properties JSON created with SDC info:" + globalPropsJson);
         }
         totalPropsStr = globalPropsJson.toString();
@@ -880,73 +883,69 @@
         return alarmCondList;
     }
 
-    private ObjectNode createAlarmCondObjectNodeByAlarmKey(List<CldsAlarmCondition> cldsAlarmCondList) {
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
-        ObjectNode alarmCondKeyNode = mapper.createObjectNode();
+    private JsonObject createAlarmCondObjectNodeByAlarmKey(List<CldsAlarmCondition> cldsAlarmCondList) {
+        JsonObject alarmCondKeyNode = new JsonObject();
         if (cldsAlarmCondList != null && !cldsAlarmCondList.isEmpty()) {
             for (CldsAlarmCondition currCldsAlarmCondition : cldsAlarmCondList) {
                 if (currCldsAlarmCondition != null) {
-                    ObjectNode alarmCondNode = mapper.createObjectNode();
-                    alarmCondNode.put("eventSourceType", currCldsAlarmCondition.getEventSourceType());
-                    alarmCondNode.put("eventSeverity", currCldsAlarmCondition.getSeverity());
-                    alarmCondKeyNode.putPOJO(currCldsAlarmCondition.getAlarmConditionKey(), alarmCondNode);
+                    JsonObject alarmCondNode = new JsonObject();
+                    alarmCondNode.addProperty("eventSourceType", currCldsAlarmCondition.getEventSourceType());
+                    alarmCondNode.addProperty("eventSeverity", currCldsAlarmCondition.getSeverity());
+                    alarmCondKeyNode.add(currCldsAlarmCondition.getAlarmConditionKey(), alarmCondNode);
                 }
             }
         } else {
-            ObjectNode alarmCondNode = mapper.createObjectNode();
-            alarmCondNode.put("eventSourceType", "");
-            alarmCondNode.put("eventSeverity", "");
-            alarmCondKeyNode.putPOJO("", alarmCondNode);
+            JsonObject alarmCondNode = new JsonObject();
+            alarmCondNode.addProperty("eventSourceType", "");
+            alarmCondNode.addProperty("eventSeverity", "");
+            alarmCondKeyNode.add("", alarmCondNode);
         }
         return alarmCondKeyNode;
     }
 
-    private ObjectNode createVfObjectNodeByServiceInvariantUuid(CldsServiceData cldsServiceData) {
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
-        ObjectNode invariantUuidObjectNode = mapper.createObjectNode();
-        ObjectNode vfObjectNode = mapper.createObjectNode();
-        ObjectNode vfUuidNode = mapper.createObjectNode();
+    private JsonObject createVfObjectNodeByServiceInvariantUuid(CldsServiceData cldsServiceData) {
+        JsonObject invariantUuidObjectNode = new JsonObject();
+        JsonObject vfObjectNode = new JsonObject();
+        JsonObject vfUuidNode = new JsonObject();
         List<CldsVfData> cldsVfsList = cldsServiceData.getCldsVfs();
         if (cldsVfsList != null && !cldsVfsList.isEmpty()) {
             for (CldsVfData currCldsVfData : cldsVfsList) {
                 if (currCldsVfData != null) {
-                    vfUuidNode.put(currCldsVfData.getVfInvariantResourceUUID(), currCldsVfData.getVfName());
+                    vfUuidNode.addProperty(currCldsVfData.getVfInvariantResourceUUID(), currCldsVfData.getVfName());
                 }
             }
         } else {
-            vfUuidNode.put("", "");
+            vfUuidNode.addProperty("", "");
         }
-        vfObjectNode.putPOJO("vf", vfUuidNode);
-        invariantUuidObjectNode.putPOJO(cldsServiceData.getServiceInvariantUUID(), vfObjectNode);
+        vfObjectNode.add("vf", vfUuidNode);
+        invariantUuidObjectNode.add(cldsServiceData.getServiceInvariantUUID(), vfObjectNode);
         return invariantUuidObjectNode;
     }
 
-    private void createKpiObjectNodeByVfUuid(ObjectNode vfResourceUuidObjectNode,
+    private void createKpiObjectNodeByVfUuid(JsonObject vfResourceUuidObjectNode,
         List<CldsVfKPIData> cldsVfKpiDataList) {
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
         if (cldsVfKpiDataList != null && !cldsVfKpiDataList.isEmpty()) {
             for (CldsVfKPIData currCldsVfKpiData : cldsVfKpiDataList) {
                 if (currCldsVfKpiData != null) {
-                    ObjectNode thresholdNameObjectNode = mapper.createObjectNode();
-                    ObjectNode fieldPathObjectNode = mapper.createObjectNode();
-                    ObjectNode nfNamingCodeNode = mapper.createObjectNode();
-                    fieldPathObjectNode.put(currCldsVfKpiData.getFieldPathValue(),
+                    JsonObject thresholdNameObjectNode = new JsonObject();
+                    JsonObject fieldPathObjectNode = new JsonObject();
+                    JsonObject nfNamingCodeNode = new JsonObject();
+                    fieldPathObjectNode.addProperty(currCldsVfKpiData.getFieldPathValue(),
                         currCldsVfKpiData.getFieldPathValue());
-                    nfNamingCodeNode.put(currCldsVfKpiData.getNfNamingValue(), currCldsVfKpiData.getNfNamingValue());
-                    thresholdNameObjectNode.putPOJO("fieldPath", fieldPathObjectNode);
-                    thresholdNameObjectNode.putPOJO("nfNamingCode", nfNamingCodeNode);
-                    vfResourceUuidObjectNode.putPOJO(currCldsVfKpiData.getThresholdValue(), thresholdNameObjectNode);
+                    nfNamingCodeNode.addProperty(currCldsVfKpiData.getNfNamingValue(), currCldsVfKpiData.getNfNamingValue());
+                    thresholdNameObjectNode.add("fieldPath", fieldPathObjectNode);
+                    thresholdNameObjectNode.add("nfNamingCode", nfNamingCodeNode);
+                    vfResourceUuidObjectNode.add(currCldsVfKpiData.getThresholdValue(), thresholdNameObjectNode);
                 }
             }
         }
     }
 
-    private void createAlarmCondObjectNodeByVfcUuid(ObjectNode vfcResourceUuidObjectNode,
+    private void createAlarmCondObjectNodeByVfcUuid(JsonObject vfcResourceUuidObjectNode,
         List<CldsVfcData> cldsVfcDataList) {
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
-        ObjectNode vfcObjectNode = mapper.createObjectNode();
-        ObjectNode alarmCondNode = mapper.createObjectNode();
-        ObjectNode alertDescNode = mapper.createObjectNode();
+        JsonObject vfcObjectNode = new JsonObject();
+        JsonObject alarmCondNode = new JsonObject();
+        JsonObject alertDescNode = new JsonObject();
         if (cldsVfcDataList != null && !cldsVfcDataList.isEmpty()) {
             for (CldsVfcData currCldsVfcData : cldsVfcDataList) {
                 if (currCldsVfcData != null) {
@@ -954,25 +953,25 @@
                         && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {
                         for (CldsAlarmCondition currCldsAlarmCondition : currCldsVfcData.getCldsAlarmConditions()) {
                             if ("alarmCondition".equalsIgnoreCase(currCldsAlarmCondition.getEventName())) {
-                                alarmCondNode.put(currCldsAlarmCondition.getAlarmConditionKey(),
+                                alarmCondNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),
                                     currCldsAlarmCondition.getAlarmConditionKey());
                             } else {
-                                alertDescNode.put(currCldsAlarmCondition.getAlarmConditionKey(),
+                                alertDescNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),
                                     currCldsAlarmCondition.getAlarmConditionKey());
                             }
                         }
                     }
-                    vfcObjectNode.putPOJO("alarmCondition", alarmCondNode);
-                    vfcObjectNode.putPOJO("alertDescription", alertDescNode);
-                    vfcResourceUuidObjectNode.putPOJO(currCldsVfcData.getVfcInvariantResourceUUID(), vfcObjectNode);
+                    vfcObjectNode.add("alarmCondition", alarmCondNode);
+                    vfcObjectNode.add("alertDescription", alertDescNode);
+                    vfcResourceUuidObjectNode.add(currCldsVfcData.getVfcInvariantResourceUUID(), vfcObjectNode);
                 }
             }
         } else {
-            alarmCondNode.put("", "");
-            vfcObjectNode.putPOJO("alarmCondition", alarmCondNode);
-            alertDescNode.put("", "");
-            vfcObjectNode.putPOJO("alertDescription", alarmCondNode);
-            vfcResourceUuidObjectNode.putPOJO("", vfcObjectNode);
+            alarmCondNode.addProperty("", "");
+            vfcObjectNode.add("alarmCondition", alarmCondNode);
+            alertDescNode.addProperty("", "");
+            vfcObjectNode.add("alertDescription", alarmCondNode);
+            vfcResourceUuidObjectNode.add("", vfcObjectNode);
         }
     }
 
@@ -983,45 +982,45 @@
      * @param cldsVfDataList
      * @return
      */
-    private ObjectNode createVfcObjectNodeByVfUuid(List<CldsVfData> cldsVfDataList) {
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();
-        ObjectNode vfUuidObjectNode = mapper.createObjectNode();
+    private JsonObject createVfcObjectNodeByVfUuid(List<CldsVfData> cldsVfDataList) {
+        JsonObject vfUuidObjectNode = new JsonObject();
         if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {
             for (CldsVfData currCldsVfData : cldsVfDataList) {
                 if (currCldsVfData != null) {
-                    ObjectNode vfObjectNode = mapper.createObjectNode();
-                    ObjectNode vfcUuidNode = mapper.createObjectNode();
-                    ObjectNode kpiObjectNode = mapper.createObjectNode();
+                    JsonObject vfObjectNode = new JsonObject();
+                    JsonObject vfcUuidNode = new JsonObject();
+                    JsonObject kpiObjectNode = new JsonObject();
                     if (currCldsVfData.getCldsVfcs() != null && !currCldsVfData.getCldsVfcs().isEmpty()) {
                         for (CldsVfcData currCldsVfcData : currCldsVfData.getCldsVfcs()) {
                             if (currCldsVfcData.getCldsAlarmConditions() != null
                                 && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {
-                                vfcUuidNode.put(currCldsVfcData.getVfcInvariantResourceUUID(),
+                                vfcUuidNode.addProperty(currCldsVfcData.getVfcInvariantResourceUUID(),
                                     currCldsVfcData.getVfcName());
                             }
                         }
                     } else {
-                        vfcUuidNode.put("", "");
+                        vfcUuidNode.addProperty("", "");
                     }
                     if (currCldsVfData.getCldsKPIList() != null && !currCldsVfData.getCldsKPIList().isEmpty()) {
                         for (CldsVfKPIData currCldsVfKPIData : currCldsVfData.getCldsKPIList()) {
-                            kpiObjectNode.put(currCldsVfKPIData.getThresholdValue(),
+                            // ToDo: something wrong happened here
+                            kpiObjectNode.addProperty(currCldsVfKPIData.getThresholdValue(),
                                 currCldsVfKPIData.getThresholdValue());
                         }
                     } else {
-                        kpiObjectNode.put("", "");
+                        kpiObjectNode.addProperty("", "");
                     }
-                    vfObjectNode.putPOJO("vfc", vfcUuidNode);
-                    vfObjectNode.putPOJO("kpi", kpiObjectNode);
-                    vfUuidObjectNode.putPOJO(currCldsVfData.getVfInvariantResourceUUID(), vfObjectNode);
+                    vfObjectNode.add("vfc", vfcUuidNode);
+                    vfObjectNode.add("kpi", kpiObjectNode);
+                    vfUuidObjectNode.add(currCldsVfData.getVfInvariantResourceUUID(), vfObjectNode);
                 }
             }
         } else {
-            ObjectNode vfcUuidNode = mapper.createObjectNode();
-            vfcUuidNode.put("", "");
-            ObjectNode vfcObjectNode = mapper.createObjectNode();
-            vfcObjectNode.putPOJO("vfc", vfcUuidNode);
-            vfUuidObjectNode.putPOJO("", vfcObjectNode);
+            JsonObject vfcUuidNode = new JsonObject();
+            vfcUuidNode.addProperty("", "");
+            JsonObject vfcObjectNode = new JsonObject();
+            vfcObjectNode.add("vfc", vfcUuidNode);
+            vfUuidObjectNode.add("", vfcObjectNode);
         }
         return vfUuidObjectNode;
     }
diff --git a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java
index efd664c..d9093f4 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/sdc/SdcRequests.java
@@ -25,11 +25,10 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.security.GeneralSecurityException;
@@ -47,7 +46,7 @@
 import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.model.sdc.SdcResource;
 import org.onap.clamp.clds.model.sdc.SdcServiceDetail;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Component;
@@ -98,16 +97,15 @@
      * @return SDC Locations request in the JSON Format
      */
     public String formatSdcLocationsReq(ModelProperties prop, String artifactName) {
-        ObjectMapper objectMapper = JacksonUtils.getObjectMapperInstance();
         Global global = prop.getGlobal();
         List<String> locationsList = global.getLocation();
-        ArrayNode locationsArrayNode = objectMapper.createArrayNode();
-        ObjectNode locationObject = objectMapper.createObjectNode();
+        JsonArray locationsArrayNode = new JsonArray();
+        JsonObject locationObject = new JsonObject();
         for (String currLocation : locationsList) {
             locationsArrayNode.add(currLocation);
         }
-        locationObject.put("artifactName", artifactName);
-        locationObject.putPOJO("locations", locationsArrayNode);
+        locationObject.addProperty("artifactName", artifactName);
+        locationObject.add("locations", locationsArrayNode);
         String locationJsonFormat = locationObject.toString();
         logger.info("Value of location Json Artifact:" + locationsArrayNode);
         return locationJsonFormat;
@@ -207,18 +205,18 @@
      */
     protected String getYamlvalue(String jsonGlobal) throws IOException {
         String yamlFileValue = "";
-        ObjectNode root = JacksonUtils.getObjectMapperInstance().readValue(jsonGlobal, ObjectNode.class);
-        Iterator<Entry<String, JsonNode>> entryItr = root.fields();
+        JsonObject root = JsonUtils.GSON.fromJson(jsonGlobal, JsonObject.class);
+        Iterator<Entry<String, JsonElement>> entryItr = root.entrySet().iterator();
         while (entryItr.hasNext()) {
-            Entry<String, JsonNode> entry = entryItr.next();
+            Entry<String, JsonElement> entry = entryItr.next();
             String key = entry.getKey();
             if (key != null && key.equalsIgnoreCase("global")) {
-                ArrayNode arrayNode = (ArrayNode) entry.getValue();
-                for (JsonNode anArrayNode : arrayNode) {
-                    ObjectNode node = (ObjectNode) anArrayNode;
-                    ArrayNode arrayValueNode = (ArrayNode) node.get("value");
-                    JsonNode jsonNode = arrayValueNode.get(0);
-                    yamlFileValue = jsonNode.asText();
+                JsonArray arrayNode = entry.getValue().getAsJsonArray();
+                for (JsonElement anArrayNode : arrayNode) {
+                    JsonObject node = anArrayNode.getAsJsonObject();
+                    JsonArray arrayValueNode = node.get("value").getAsJsonArray();
+                    JsonElement jsonNode = arrayValueNode.get(0);
+                    yamlFileValue = jsonNode.getAsString();
                     logger.info("value:" + yamlFileValue);
                 }
                 break;
diff --git a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
index 1478342..6b8f043 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java
@@ -25,10 +25,9 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import java.util.Map;
 
@@ -38,6 +37,7 @@
 import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.model.properties.TcaItem;
 import org.onap.clamp.clds.model.properties.TcaThreshold;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.yaml.snakeyaml.Yaml;
 
 /**
@@ -71,10 +71,10 @@
             modelProperties.setCurrentModelElementId(tca.getId());
             // Always one tcaItem so must be set to id 0
             modelProperties.setPolicyUniqueId("0");
-            ObjectNode rootNode = (ObjectNode) refProp.getJsonTemplate("tca.policy.template", service);
+            JsonObject rootNode = refProp.getJsonTemplate("tca.policy.template", service ).getAsJsonObject();
             String policyName = modelProperties.getCurrentPolicyScopeAndPolicyName();
-            rootNode.put("policyName", policyName);
-            ((ObjectNode) rootNode.get("content")).replace("tca_policy",
+            rootNode.addProperty("policyName", policyName);
+            rootNode.get("content").getAsJsonObject().add("tca_policy",
                     createPolicyContent(refProp, modelProperties, service, policyName, tca));
             String tcaPolicyReq = rootNode.toString();
             logger.info("tcaPolicyReq=" + tcaPolicyReq);
@@ -104,7 +104,7 @@
      *            modelProperties.setCurrentModelElementId will be used
      * @return The Json node containing what should be sent to policy
      */
-    public static JsonNode createPolicyContent(ClampProperties refProp, ModelProperties modelProperties, String service,
+    public static JsonObject createPolicyContent(ClampProperties refProp, ModelProperties modelProperties, String service,
             String policyName, Tca tca) {
         try {
             String serviceToUse = service;
@@ -120,14 +120,12 @@
             if (policyNameToUse == null) {
                 policyNameToUse = modelProperties.getCurrentPolicyScopeAndPolicyName();
             }
-            ObjectNode rootNode = (ObjectNode) refProp.getJsonTemplate("tca.template", serviceToUse);
-            ((ObjectNode) rootNode.get("metricsPerEventName").get(0)).put("eventName",
-                    tcaToUse.getTcaItem().getEventName());
-            ((ObjectNode) rootNode.get("metricsPerEventName").get(0)).put("policyName", policyNameToUse);
-            ((ObjectNode) rootNode.get("metricsPerEventName").get(0)).put("controlLoopSchemaType",
-                    tcaToUse.getTcaItem().getControlLoopSchemaType());
-            ObjectNode thresholdsParent = ((ObjectNode) rootNode.get("metricsPerEventName").get(0));
-            addThresholds(refProp, serviceToUse, thresholdsParent, tcaToUse.getTcaItem(), modelProperties);
+            JsonObject rootNode = refProp.getJsonTemplate("tca.template", serviceToUse).getAsJsonObject();
+            JsonObject metricsPerEventName = rootNode.get("metricsPerEventName").getAsJsonArray().get(0).getAsJsonObject();
+            metricsPerEventName.addProperty("eventName", tcaToUse.getTcaItem().getEventName());
+            metricsPerEventName.addProperty("policyName", policyNameToUse);
+            metricsPerEventName.addProperty("controlLoopSchemaType",tcaToUse.getTcaItem().getControlLoopSchemaType());
+            addThresholds(refProp, serviceToUse, metricsPerEventName, tcaToUse.getTcaItem(), modelProperties);
             logger.info("tcaPolicyContent=" + rootNode.toString());
             return rootNode;
         } catch (IOException e) {
@@ -154,17 +152,17 @@
      *            The Model Properties created from BPMN JSON and BPMN
      *            properties JSON
      */
-    private static void addThresholds(ClampProperties refProp, String service, ObjectNode appendToNode, TcaItem tcaItem,
+    private static void addThresholds(ClampProperties refProp, String service, JsonObject appendToNode, TcaItem tcaItem,
             ModelProperties modelProperties) {
-        ArrayNode tcaNodes = appendToNode.withArray("thresholds");
+        JsonArray tcaNodes = appendToNode.get("thresholds").getAsJsonArray();
         try {
             for (TcaThreshold tcaThreshold : tcaItem.getTcaThresholds()) {
-                ObjectNode tcaNode = (ObjectNode) refProp.getJsonTemplate("tca.thresholds.template", service);
-                tcaNode.put("closedLoopControlName", modelProperties.getControlNameAndPolicyUniqueId());
-                tcaNode.put("fieldPath", tcaThreshold.getFieldPath());
-                tcaNode.put("thresholdValue", tcaThreshold.getThreshold());
-                tcaNode.put("direction", tcaThreshold.getOperator());
-                tcaNode.put("closedLoopEventStatus", tcaThreshold.getClosedLoopEventStatus());
+                JsonObject tcaNode = refProp.getJsonTemplate("tca.thresholds.template", service).getAsJsonObject();
+                tcaNode.addProperty("closedLoopControlName", modelProperties.getControlNameAndPolicyUniqueId());
+                tcaNode.addProperty("fieldPath", tcaThreshold.getFieldPath());
+                tcaNode.addProperty("thresholdValue", tcaThreshold.getThreshold());
+                tcaNode.addProperty("direction", tcaThreshold.getOperator());
+                tcaNode.addProperty("closedLoopEventStatus", tcaThreshold.getClosedLoopEventStatus());
                 tcaNodes.add(tcaNode);
             }
         } catch (IOException e) {
@@ -187,7 +185,7 @@
      */
     public static String updatedBlueprintWithConfiguration(ClampProperties refProp, ModelProperties modelProperties,
             String yamlValue) {
-        String jsonPolicy = ((ObjectNode) createPolicyContent(refProp, modelProperties, null, null, null)).toString();
+        String jsonPolicy = JsonUtils.GSON.toJson(createPolicyContent(refProp, modelProperties, null, null, null));
         logger.info("Yaml that will be updated:" + yamlValue);
         Yaml yaml = new Yaml();
         Map<String, Object> loadedYaml = (Map<String, Object>) yaml.load(yamlValue);
diff --git a/src/main/java/org/onap/clamp/clds/config/ClampProperties.java b/src/main/java/org/onap/clamp/clds/config/ClampProperties.java
index 9acad94..4f1e8a2 100644
--- a/src/main/java/org/onap/clamp/clds/config/ClampProperties.java
+++ b/src/main/java/org/onap/clamp/clds/config/ClampProperties.java
@@ -23,16 +23,16 @@
 
 package org.onap.clamp.clds.config;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.base.Splitter;
 
+import com.google.gson.JsonElement;
 import java.io.IOException;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.env.Environment;
@@ -89,10 +89,10 @@
      * @throws IOException
      *         In case of issues with the JSON parser
      */
-    public JsonNode getJsonTemplate(String key) throws IOException {
+    public JsonElement getJsonTemplate(String key) throws IOException {
         String fileReference = getStringValue(key);
         return (fileReference != null)
-            ? JacksonUtils.getObjectMapperInstance().readValue(getFileContentFromPath(fileReference), JsonNode.class)
+            ? JsonUtils.GSON.fromJson(getFileContentFromPath(fileReference), JsonElement.class)
             : null;
     }
 
@@ -109,10 +109,10 @@
      * @throws IOException
      *         In case of issues with the JSON parser
      */
-    public JsonNode getJsonTemplate(String key1, String key2) throws IOException {
+    public JsonElement getJsonTemplate(String key1, String key2) throws IOException {
         String fileReference = getStringValue(key1, key2);
         return (fileReference != null)
-            ? JacksonUtils.getObjectMapperInstance().readValue(getFileContentFromPath(fileReference), JsonNode.class)
+            ? JsonUtils.GSON.fromJson(getFileContentFromPath(fileReference), JsonElement.class)
             : null;
     }
 
diff --git a/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java b/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java
index 0b87333..d1beb95 100644
--- a/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java
+++ b/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java
@@ -23,14 +23,18 @@
 
 package org.onap.clamp.clds.config;
 
+import com.google.gson.JsonParseException;
+import com.google.gson.reflect.TypeToken;
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.reflect.Type;
 import java.nio.charset.StandardCharsets;
 
+import java.util.List;
 import org.apache.commons.io.IOUtils;
 import org.onap.clamp.clds.exception.CldsUsersException;
 import org.onap.clamp.clds.service.CldsUser;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 
 public class CldsUserJsonDecoder {
 
@@ -55,8 +59,8 @@
         try {
             // the ObjectMapper readValue method closes the stream no need to do
             // it
-            return JacksonUtils.getObjectMapperInstance().readValue(cldsUsersString, CldsUser[].class);
-        } catch (IOException e) {
+            return JsonUtils.GSON.fromJson(cldsUsersString, CldsUser[].class);
+        } catch (JsonParseException e) {
             throw new CldsUsersException("Exception occurred during the decoding of the clds-users.json", e);
         }
     }
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java
index 2cab17b..2f0e698 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java
@@ -23,13 +23,16 @@
 
 package org.onap.clamp.clds.config.sdc;
 
-import com.fasterxml.jackson.core.type.TypeReference;
 
-import java.io.IOException;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import com.google.gson.reflect.TypeToken;
 import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
-
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * This class is used to decode the configuration found in
@@ -39,6 +42,8 @@
  */
 public class BlueprintParserMappingConfiguration {
 
+    private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken<List<BlueprintParserMappingConfiguration>>() {
+    }.getType();
     private String blueprintKey;
     private boolean dcaeDeployable;
     private BlueprintParserFilesConfiguration files;
@@ -63,9 +68,7 @@
         return dcaeDeployable;
     }
 
-    public static List<BlueprintParserMappingConfiguration> createFromJson(InputStream json) throws IOException {
-        TypeReference<List<BlueprintParserMappingConfiguration>> mapType = new TypeReference<List<BlueprintParserMappingConfiguration>>() {
-        };
-        return JacksonUtils.getObjectMapperInstance().readValue(json, mapType);
+    public static List<BlueprintParserMappingConfiguration> createFromJson(InputStream json) {
+        return JsonUtils.GSON.fromJson(new InputStreamReader(json, StandardCharsets.UTF_8), BLUEPRINT_MAP_CONF_TYPE);
     }
 }
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
index 0f75d46..b21c75f 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
@@ -25,16 +25,18 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonObject;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.annotation.PostConstruct;
 
 import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.ApplicationContext;
@@ -59,13 +61,13 @@
     /**
      * The root of the JSON.
      */
-    private JsonNode jsonRootNode;
+    private JsonObject jsonRootNode;
 
     @PostConstruct
     public void loadConfiguration() throws IOException {
         Resource resource = appContext.getResource(sdcControllerFile);
         // Try to load json tree
-        jsonRootNode = JacksonUtils.getObjectMapperInstance().readValue(resource.getInputStream(), JsonNode.class);
+        jsonRootNode = JsonUtils.GSON.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), JsonObject.class);
     }
 
     public SdcSingleControllerConfiguration getSdcSingleControllerConfiguration(String controllerName) {
@@ -80,8 +82,9 @@
     public Map<String, SdcSingleControllerConfiguration> getAllDefinedControllers() {
         Map<String, SdcSingleControllerConfiguration> result = new HashMap<>();
         if (jsonRootNode.get(CONTROLLER_SUBTREE_KEY) != null) {
-            jsonRootNode.get(CONTROLLER_SUBTREE_KEY).fields().forEachRemaining(entry -> result.put(entry.getKey(),
-                    new SdcSingleControllerConfiguration(entry.getValue(), entry.getKey())));
+            jsonRootNode.get(CONTROLLER_SUBTREE_KEY).getAsJsonObject().entrySet().forEach(
+                entry -> result.put(entry.getKey(),
+                    new SdcSingleControllerConfiguration(entry.getValue().getAsJsonObject(), entry.getKey())));
         } else {
             throw new SdcParametersException(
                     CONTROLLER_SUBTREE_KEY + " key not found in the file: " + sdcControllerFile);
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
index ca756aa..564e01f 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
@@ -25,8 +25,8 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonObject;
 import java.security.GeneralSecurityException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -52,7 +52,7 @@
     /**
      * The root of the JSON.
      */
-    private JsonNode jsonRootNode;
+    private JsonObject jsonRootNode;
     // All keys that can be present in the JSON
     public static final String CONSUMER_GROUP_ATTRIBUTE_NAME = "consumerGroup";
     public static final String CONSUMER_ID_ATTRIBUTE_NAME = "consumerId";
@@ -90,12 +90,12 @@
      * This constructor builds a SdcSingleControllerConfiguration from the
      * corresponding json.
      * 
-     * @param jsonRootNode
+     * @param jsonNode
      *            The JSON node
      * @param controllerName
      *            The controller name that must appear in the JSON
      */
-    public SdcSingleControllerConfiguration(JsonNode jsonNode, String controllerName) {
+    public SdcSingleControllerConfiguration(JsonObject jsonNode, String controllerName) {
         jsonRootNode = jsonNode;
         setSdcControllerName(controllerName);
         testAllRequiredParameters();
@@ -113,7 +113,7 @@
 
     private String getStringConfig(String key) {
         if (jsonRootNode != null && jsonRootNode.get(key) != null) {
-            String config = jsonRootNode.get(key).asText();
+            String config = jsonRootNode.get(key).getAsString();
             return config.isEmpty() ? null : config;
         }
         return null;
@@ -121,7 +121,7 @@
 
     private Integer getIntConfig(String key) {
         if (jsonRootNode != null && jsonRootNode.get(key) != null) {
-            return jsonRootNode.get(key).asInt();
+            return jsonRootNode.get(key).getAsInt();
         } else {
             return 0;
         }
@@ -129,8 +129,8 @@
 
     private String getEncryptedStringConfig(String key) throws GeneralSecurityException, DecoderException {
         if (jsonRootNode != null && jsonRootNode.get(key) != null) {
-            return jsonRootNode.get(key).asText().isEmpty() ? null
-                    : CryptoUtils.decrypt(jsonRootNode.get(key).asText());
+            return jsonRootNode.get(key).getAsString().isEmpty() ? null
+                    : CryptoUtils.decrypt(jsonRootNode.get(key).getAsString());
         }
         return null;
     }
@@ -143,7 +143,7 @@
     @Override
     public String getConsumerGroup() {
         if (jsonRootNode != null && jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME) != null) {
-            String config = jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME).asText();
+            String config = jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME).getAsString();
             return "NULL".equals(config) || config.isEmpty() ? null : config;
         }
         return null;
@@ -198,8 +198,8 @@
 
     @Override
     public boolean activateServerTLSAuth() {
-        if (jsonRootNode != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH) != null) {
-            return jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).asBoolean(false);
+        if (jsonRootNode != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH) != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).isJsonPrimitive()) {
+            return jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).getAsBoolean();
         } else {
             return false;
         }
@@ -231,7 +231,7 @@
             throw new SdcParametersException("Json is null for controller " + this.getSdcControllerName());
         }
         if (this.getConsumerGroup() == null && (jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME) == null
-                || !"NULL".equals(jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME).asText()))) {
+                || !"NULL".equals(jsonRootNode.get(CONSUMER_GROUP_ATTRIBUTE_NAME).getAsString()))) {
             throw new SdcParametersException(CONSUMER_GROUP_ATTRIBUTE_NAME + errorMessageKeyNotFound);
         }
         if (this.getConsumerID() == null || this.getConsumerID().isEmpty()) {
@@ -277,7 +277,7 @@
     public List<String> getMsgBusAddress() {
         List<String> addressesList = new ArrayList<>();
         if (jsonRootNode != null && jsonRootNode.get(MESSAGE_BUS_ADDRESSES) != null) {
-            jsonRootNode.get(MESSAGE_BUS_ADDRESSES).forEach(k -> addressesList.add(k.asText()));
+            jsonRootNode.get(MESSAGE_BUS_ADDRESSES).getAsJsonArray().forEach(k -> addressesList.add(k.getAsString()));
             return addressesList;
         } else {
             return addressesList;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModelInstance.java b/src/main/java/org/onap/clamp/clds/model/CldsModelInstance.java
index 75801ae..082bfe3 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsModelInstance.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsModelInstance.java
@@ -23,9 +23,6 @@
 
 package org.onap.clamp.clds.model;
 
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
 public class CldsModelInstance {
 
     private String modelInstanceId;
diff --git a/src/main/java/org/onap/clamp/clds/model/actions/ActionsHandler.java b/src/main/java/org/onap/clamp/clds/model/actions/ActionsHandler.java
index 1c54dae..bafe48d 100644
--- a/src/main/java/org/onap/clamp/clds/model/actions/ActionsHandler.java
+++ b/src/main/java/org/onap/clamp/clds/model/actions/ActionsHandler.java
@@ -24,14 +24,13 @@
 package org.onap.clamp.clds.model.actions;
 
 import com.att.eelf.configuration.EELFLogger;
-import com.fasterxml.jackson.databind.JsonNode;
-
-import java.io.IOException;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
 import java.util.Arrays;
 import java.util.List;
-
 import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Interface for actions that the user can do according to the last event.
@@ -44,7 +43,7 @@
         SIMPLE_MODEL("simpleModel"), POLICY_MODEL("policyModel");
         private final String type;
 
-        private ModelType(String type) {
+        ModelType(String type) {
             this.type = type;
         }
 
@@ -53,7 +52,7 @@
         }
     }
 
-    public EELFLogger getLogger();
+    EELFLogger getLogger();
 
     /**
      * This method determines a list of actions that the user can do according to
@@ -155,13 +154,15 @@
         boolean result = false;
         try {
             if (propText != null) {
-                JsonNode modelJson = JacksonUtils.getObjectMapperInstance().readTree(propText);
-                JsonNode modelJsonOfType = modelJson.get(key.getType());
-                if (modelJsonOfType != null && modelJsonOfType.asBoolean()) {
+                JsonObject modelJson = JsonUtils.GSON.fromJson(propText, JsonObject.class);
+                JsonElement modelJsonOfType = modelJson.get(key.getType());
+                if (modelJsonOfType != null
+                    && modelJsonOfType.isJsonPrimitive()
+                    && modelJsonOfType.getAsJsonPrimitive().getAsBoolean()) {
                     result = true;
                 }
             }
-        } catch (IOException e) {
+        } catch (JsonParseException e) {
             getLogger().error("Error while parsing propText json", e);
         }
         return result;
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java b/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java
index 571e5b1..8e8debe 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/AbstractModelElement.java
@@ -25,15 +25,12 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
 
 /**
- * Provide base ModelElement functionality. Perform base parsing of properties
- * for a ModelElement (such as, VesCollector, Policy, Tca, Holmes, ...)
+ * Provide base ModelElement functionality. Perform base parsing of properties for a ModelElement (such as,
+ * VesCollector, Policy, Tca, Holmes, ...)
  */
 public abstract class AbstractModelElement {
 
@@ -43,17 +40,14 @@
     private final ModelBpmn modelBpmn;
     private final String id;
     protected String topicPublishes;
-    protected final JsonNode modelElementJsonNode;
+    protected final JsonElement modelElementJsonNode;
     private boolean isFound;
     private final ModelProperties modelProp;
-    private static final String LOG_ELEMENT_NOT_FOUND = "Value '{}' for key 'name' not found in JSON";
-    private static final String LOG_ELEMENT_NOT_FOUND_IN_JSON = "Value '{}' for key 'name' not found in JSON {}";
 
     /**
-     * Perform base parsing of properties for a ModelElement (such as, VesCollector,
-     * Policy and Tca)
+     * Perform base parsing of properties for a ModelElement (such as, VesCollector, Policy and Tca)
      */
-    protected AbstractModelElement(String type, ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) {
+    protected AbstractModelElement(String type, ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) {
         this.type = type;
         this.modelProp = modelProp;
         this.modelBpmn = modelBpmn;
@@ -69,163 +63,6 @@
         return topicPublishes;
     }
 
-    /**
-     * Return the value field of the json node element that has a name field equals
-     * to the given name.
-     */
-    public static String getValueByName(JsonNode nodeIn, String name) {
-        String value = null;
-        if (nodeIn != null) {
-            for (JsonNode node : nodeIn) {
-                if (node.path("name").asText().equals(name)) {
-                    JsonNode vnode = node.path("value");
-                    if (vnode.isArray()) {
-                        // if array, assume value is in first element
-                        value = vnode.path(0).asText();
-                    } else {
-                        // otherwise, just return text
-                        value = vnode.asText();
-                    }
-                }
-            }
-        }
-        if (value == null || value.length() == 0) {
-            logger.warn(LOG_ELEMENT_NOT_FOUND, name);
-        } else {
-            logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, nodeIn.toString());
-        }
-        return value;
-    }
-
-    /**
-     * Return the Json value field of the json node element that has a name field
-     * equals to the given name.
-     */
-    public static JsonNode getJsonNodeByName(JsonNode nodeIn, String name) {
-        JsonNode vnode = null;
-        if (nodeIn != null) {
-            for (JsonNode node : nodeIn) {
-                if (node.path("name").asText().equals(name)) {
-                    vnode = node.path("value");
-                }
-            }
-        }
-        if (vnode == null) {
-            logger.warn(LOG_ELEMENT_NOT_FOUND, name);
-        } else {
-            logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, nodeIn.toString());
-        }
-        return vnode;
-    }
-
-    /**
-     * Return the value field of the json node element that has a name field that
-     * equals the given name.
-     */
-    public static String getNodeValueByName(JsonNode nodeIn, String name) {
-        String value = null;
-        if (nodeIn != null) {
-            value = nodeIn.path(name).asText();
-        }
-        if (value == null || value.length() == 0) {
-            logger.warn(LOG_ELEMENT_NOT_FOUND, name);
-        } else {
-            logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, nodeIn.toString());
-        }
-        return value;
-    }
-
-    /**
-     * Return the value field of the json node element that has a name field that
-     * equals the given name.
-     */
-    public static List<String> getNodeValuesByName(JsonNode nodeIn, String name) {
-        List<String> values = new ArrayList<>();
-        if (nodeIn != null) {
-            for (JsonNode node : nodeIn) {
-                if (node.path("name").asText().equals(name)) {
-                    JsonNode vnode = node.path("value");
-                    if (vnode.isArray()) {
-                        // if array, assume value is in first element
-                        values.add(vnode.path(0).asText());
-                    } else {
-                        // otherwise, just return text
-                        values.add(vnode.asText());
-                    }
-                }
-            }
-        }
-        return values;
-    }
-
-    /**
-     * Return the int value field of the json node element that has a name field
-     * equals to the given name.
-     */
-    public static Integer getIntValueByName(JsonNode nodeIn, String name) {
-        String value = getValueByName(nodeIn, name);
-        return Integer.valueOf(value);
-    }
-
-    /**
-     * Return an array of values for the field of the json node element that has a
-     * name field equals to the given name.
-     */
-    public static List<String> getValuesByName(JsonNode nodeIn, String name) {
-        List<String> values = null;
-        if (nodeIn != null) {
-            for (JsonNode node : nodeIn) {
-                if (node.path("name").asText().equals(name)) {
-                    values = getValuesList(node);
-                }
-            }
-        }
-        if (values == null || values.isEmpty()) {
-            logger.warn(LOG_ELEMENT_NOT_FOUND, name);
-        } else {
-            logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, nodeIn.toString());
-        }
-        return values;
-    }
-
-    /**
-     * Return an array of String values.
-     */
-    public static List<String> getValuesList(JsonNode nodeIn) {
-        ArrayList<String> al = new ArrayList<>();
-        if (nodeIn != null) {
-            Iterator<JsonNode> itr = nodeIn.path("value").elements();
-            while (itr.hasNext()) {
-                JsonNode node = itr.next();
-                al.add(node.asText());
-            }
-        }
-        return al;
-    }
-
-    /**
-     * Return the value field of the json node element that has a name field equals
-     * to the given name.
-     */
-    public String getValueByName(String name) {
-        return getValueByName(modelElementJsonNode, name);
-    }
-
-    /**
-     * Return the int value field of the json node element that has a name field
-     * equals to the given name.
-     */
-    public Integer getIntValueByName(String name) {
-        return getIntValueByName(modelElementJsonNode, name);
-    }
-
-    /**
-     * Return an array of values for the field of the json node element that has a
-     * name field equals to the given name.
-     */
-    public List<String> getValuesByName(String name) {
-        return getValuesByName(modelElementJsonNode, name);
-    }
 
     /**
      * @return the id
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/Global.java b/src/main/java/org/onap/clamp/clds/model/properties/Global.java
index e867407..6649148 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/Global.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Global.java
@@ -25,9 +25,11 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
 import java.util.List;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse global json properties.
@@ -45,7 +47,7 @@
     private String actionSet;
     private List<String> resourceVf;
     private List<String> resourceVfc;
-    private JsonNode deployParameters;
+    private JsonObject deployParameters;
     private List<String> location;
     private String vnfScope;
 
@@ -54,15 +56,15 @@
      *
      * @param modelJson
      */
-    public Global(JsonNode modelJson) {
-        JsonNode globalNode = modelJson.get("global");
-        service = AbstractModelElement.getValueByName(globalNode, "service");
-        actionSet = AbstractModelElement.getValueByName(globalNode, "actionSet");
-        resourceVf = AbstractModelElement.getValuesByName(globalNode, "vf");
-        resourceVfc = AbstractModelElement.getValuesByName(globalNode, "vfc");
-        deployParameters = AbstractModelElement.getJsonNodeByName(globalNode, "deployParameters");
-        location = AbstractModelElement.getValuesByName(globalNode, "location");
-        vnfScope = AbstractModelElement.getValueByName(globalNode, "vnf");
+    public Global(JsonObject modelJson) {
+        JsonElement globalNode = modelJson.get("global");
+        service = JsonUtils.getStringValueByName(globalNode, "service");
+        actionSet = JsonUtils.getStringValueByName(globalNode, "actionSet");
+        resourceVf = JsonUtils.getStringValuesByName(globalNode, "vf");
+        resourceVfc = JsonUtils.getStringValuesByName(globalNode, "vfc");
+        deployParameters = JsonUtils.getJsonObjectByName(globalNode, "deployParameters");
+        location = JsonUtils.getStringValuesByName(globalNode, "location");
+        vnfScope = JsonUtils.getStringValueByName(globalNode, "vnf");
     }
 
     /**
@@ -136,11 +138,11 @@
         this.location = location;
     }
 
-    public JsonNode getDeployParameters() {
+    public JsonObject getDeployParameters() {
         return deployParameters;
     }
 
-    public void setDeployParameters(JsonNode deployParameters) {
+    public void setDeployParameters(JsonObject deployParameters) {
         this.deployParameters = deployParameters;
     }
 
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
index 530e2db..b0607e9 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Holmes.java
@@ -23,7 +23,8 @@
 
 package org.onap.clamp.clds.model.properties;
 
-import com.fasterxml.jackson.databind.JsonNode;
+import com.google.gson.JsonObject;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse Holmes bpmn parameters json properties.
@@ -49,11 +50,11 @@
      * @param modelBpmn
      * @param modelJson
      */
-    public Holmes(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) {
+    public Holmes(ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) {
         super(TYPE_HOLMES, modelProp, modelBpmn, modelJson);
 
-        correlationLogic = this.getValueByName("correlationalLogic");
-        configPolicyName = this.getValueByName("configPolicyName");
+        correlationLogic = JsonUtils.getStringValueByName(modelElementJsonNode, "correlationalLogic");
+        configPolicyName = JsonUtils.getStringValueByName(modelElementJsonNode, "configPolicyName");
     }
 
     public static final String getType() {
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java
index dbd5d8a..248a52f 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelBpmn.java
@@ -25,11 +25,11 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
-import java.io.IOException;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -39,7 +39,7 @@
 
 import org.onap.clamp.clds.exception.ModelBpmnException;
 import org.onap.clamp.clds.service.CldsService;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse Model BPMN properties.
@@ -66,22 +66,22 @@
     public static ModelBpmn create(String modelBpmnPropText) {
         try {
             ModelBpmn modelBpmn = new ModelBpmn();
-            ObjectNode root = JacksonUtils.getObjectMapperInstance().readValue(modelBpmnPropText, ObjectNode.class);
+            JsonObject root = JsonUtils.GSON.fromJson(modelBpmnPropText, JsonObject.class);
             // iterate over each entry like:
             // "Policy":[{"id":"Policy","from":"StartEvent_1"}]
-            Iterator<Entry<String, JsonNode>> entryItr = root.fields();
+            Iterator<Entry<String, JsonElement>> entryItr = root.entrySet().iterator();
             List<String> bpmnElementIdList = new ArrayList<>();
             while (entryItr.hasNext()) {
                 // process the entry
-                Entry<String, JsonNode> entry = entryItr.next();
+                Entry<String, JsonElement> entry = entryItr.next();
                 String type = entry.getKey();
-                ArrayNode arrayNode = (ArrayNode) entry.getValue();
+                JsonArray arrayNode = entry.getValue().getAsJsonArray();
                 // process each id/from object, like:
                 // {"id":"Policy","from":"StartEvent_1"}
-                for (JsonNode anArrayNode : arrayNode) {
-                    ObjectNode node = (ObjectNode) anArrayNode;
-                    String id = node.get("id").asText();
-                    String fromId = node.get("from").asText();
+                for (JsonElement anArrayNode : arrayNode) {
+                    JsonObject node = anArrayNode.getAsJsonObject();
+                    String id = node.get("id").getAsString();
+                    String fromId = node.get("from").getAsString();
                     ModelBpmnEntry modelBpmnEntry = new ModelBpmnEntry(type, id, fromId);
                     modelBpmn.addEntry(modelBpmnEntry);
                     bpmnElementIdList.add(id);
@@ -89,7 +89,7 @@
                 modelBpmn.setBpmnElementIds(bpmnElementIdList);
             }
             return modelBpmn;
-        } catch (IOException e) {
+        } catch (JsonParseException e) {
             throw new ModelBpmnException("Exception occurred during the decoding of the bpmn JSON", e);
         }
     }
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java
index 3d7bbcc..61eeac1 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java
@@ -25,23 +25,21 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-
-import java.io.IOException;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-
 import org.apache.camel.Exchange;
 import org.onap.clamp.clds.client.req.policy.PolicyClient;
 import org.onap.clamp.clds.config.ClampProperties;
 import org.onap.clamp.clds.exception.ModelBpmnException;
 import org.onap.clamp.clds.model.CldsModel;
 import org.onap.clamp.clds.service.CldsService;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse model properties.
@@ -51,7 +49,7 @@
     protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsService.class);
     protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
     private ModelBpmn modelBpmn;
-    private JsonNode modelJson;
+    private JsonObject modelJson;
     private final String modelName;
     private final String controlName;
     private final String actionCd;
@@ -65,6 +63,7 @@
     public static final String POLICY_GUARD_SUFFIX = "_Guard_";
     private static final Object lock = new Object();
     private static Map<Class<? extends AbstractModelElement>, String> modelElementClasses = new ConcurrentHashMap<>();
+
     static {
         synchronized (lock) {
             modelElementClasses.put(Policy.class, Policy.getType());
@@ -99,9 +98,9 @@
             this.actionCd = actionCd;
             this.testOnly = isATest;
             modelBpmn = ModelBpmn.create(modelBpmnText);
-            modelJson = JacksonUtils.getObjectMapperInstance().readTree(modelPropText);
+            modelJson = JsonUtils.GSON.fromJson(modelPropText, JsonObject.class);
             instantiateMissingModelElements();
-        } catch (IOException e) {
+        } catch (JsonParseException e) {
             throw new ModelBpmnException("Exception occurred when trying to decode the BPMN Properties JSON", e);
         }
     }
@@ -112,7 +111,7 @@
      * after instantiation of this ModelProperties, we need to build the missing
      * ModelElement instances.
      */
-    private final void instantiateMissingModelElements() {
+    private void instantiateMissingModelElements() {
         if (modelElementClasses.size() != modelElements.size()) {
             Set<String> missingTypes = new HashSet<>(modelElementClasses.values());
             missingTypes.removeAll(modelElements.keySet());
@@ -124,11 +123,11 @@
                 .forEach(entry -> {
                     try {
                         modelElements.put(entry.getValue(),
-                            (entry.getKey().getConstructor(ModelProperties.class, ModelBpmn.class, JsonNode.class)
+                            (entry.getKey().getConstructor(ModelProperties.class, ModelBpmn.class, JsonObject.class)
                                 .newInstance(this, modelBpmn, modelJson)));
                     } catch (InstantiationException | NoSuchMethodException | IllegalAccessException
                         | InvocationTargetException e) {
-                        logger.warn("Unable to instantiate a ModelElement, exception follows: ", e);
+                        logger.warn("Unable to instantiate a ModelElement "+ entry.getValue()+", exception follows: ", e);
                     }
                 });
         }
@@ -143,10 +142,10 @@
     public static String getVf(CldsModel model) {
         List<String> vfs = null;
         try {
-            JsonNode modelJson = JacksonUtils.getObjectMapperInstance().readTree(model.getPropText());
+            JsonObject modelJson = JsonUtils.GSON.fromJson(model.getPropText(), JsonObject.class);
             Global global = new Global(modelJson);
             vfs = global.getResourceVf();
-        } catch (IOException e) {
+        } catch (JsonParseException e) {
             logger.warn("no VF found", e);
         }
         String vf = null;
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/Policy.java b/src/main/java/org/onap/clamp/clds/model/properties/Policy.java
index 501eb80..059d732 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/Policy.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Policy.java
@@ -25,12 +25,14 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map.Entry;
 
 /**
  * Parse Policy json properties.
@@ -65,15 +67,15 @@
      * @param modelJson
      * @throws IOException
      */
-    public Policy(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) throws IOException {
+    public Policy(ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) throws IOException {
         super(TYPE_POLICY, modelProp, modelBpmn, modelJson);
 
         // process policies
         if (modelElementJsonNode != null) {
-            Iterator<JsonNode> itr = modelElementJsonNode.elements();
+            Iterator<Entry<String, JsonElement>> itr = modelElementJsonNode.getAsJsonObject().entrySet().iterator();
             policyChains = new ArrayList<>();
             while (itr.hasNext()) {
-                policyChains.add(new PolicyChain(itr.next()));
+                policyChains.add(new PolicyChain(itr.next().getValue()));
             }
         }
     }
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java b/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java
index cf24c78..f29ba16 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/PolicyChain.java
@@ -25,12 +25,13 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse Policy json properties.
@@ -66,20 +67,21 @@
     private List<PolicyItem>          policyItems;
     private String                    policyType;
 
-    public PolicyChain(JsonNode node) throws IOException {
+    public PolicyChain(JsonElement node) throws IOException {
+        if (node != null && node.isJsonArray() && node.getAsJsonArray().size() > 0) {
+            JsonArray operationalPolicyParameters = node.getAsJsonArray();
+            policyId = JsonUtils.getStringValueByName(node, "pid");
+            timeout = JsonUtils.getIntValueByName(node, "timeout");
+            policyType = JsonUtils.getStringValueByName(node, "policyType");
 
-        policyId = AbstractModelElement.getValueByName(node, "pid");
-        timeout = AbstractModelElement.getIntValueByName(node, "timeout");
-        policyType = AbstractModelElement.getValueByName(node, "policyType");
-
-        if(node != null && node.size() > 0) {
-            JsonNode policyNode = node.get(node.size() - 1).get("policyConfigurations");
-            if(policyNode != null) {
-                Iterator<JsonNode> itr = policyNode.elements();
-                policyItems = new ArrayList<>();
-                while (itr.hasNext()) {
-                    policyItems.add(new PolicyItem(itr.next()));
-                }
+            JsonArray policyConfigurations = operationalPolicyParameters.get(operationalPolicyParameters.size() - 1)
+                .getAsJsonObject()
+                .get("policyConfigurations")
+                .getAsJsonArray();
+            Iterator<JsonElement> itr = policyConfigurations.iterator();
+            policyItems = new ArrayList<>();
+            while (itr.hasNext()) {
+                policyItems.add(new PolicyItem(itr.next()));
 
             }
         }
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java
index d6deddc..bb57d5d 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/PolicyItem.java
@@ -25,14 +25,14 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.yaml.snakeyaml.Yaml;
 
 /**
@@ -86,51 +86,48 @@
     /**
      * Parse Policy given json node.
      *
-     * @param node
+     * @param item
      * @throws IOException
      */
-    public PolicyItem(JsonNode node) throws IOException {
-        id = AbstractModelElement.getValueByName(node, "_id");
-        recipe = AbstractModelElement.getValueByName(node, "recipe");
-        maxRetries = AbstractModelElement.getIntValueByName(node, "maxRetries");
-        retryTimeLimit = AbstractModelElement.getIntValueByName(node, "retryTimeLimit");
-        parentPolicy = AbstractModelElement.getValueByName(node, "parentPolicy");
-        parentPolicyConditions = AbstractModelElement.getValuesByName(node, "parentPolicyConditions");
-        targetResourceId = AbstractModelElement.getValueByName(node, "targetResourceId");
+    public PolicyItem(JsonElement item) throws IOException {
+        id = JsonUtils.getStringValueByName(item, "_id");
+        recipe = JsonUtils.getStringValueByName(item, "recipe");
+        maxRetries = JsonUtils.getIntValueByName(item, "maxRetries");
+        retryTimeLimit = JsonUtils.getIntValueByName(item, "retryTimeLimit");
+        parentPolicy = JsonUtils.getStringValueByName(item, "parentPolicy");
+        parentPolicyConditions = JsonUtils.getStringValuesByName(item, "parentPolicyConditions");
+        targetResourceId = JsonUtils.getStringValueByName(item, "targetResourceId");
         if (targetResourceId != null && targetResourceId.isEmpty()) {
             this.setTargetResourceId(null);
         }
-        recipeInfo = AbstractModelElement.getValueByName(node, "recipeInfo");
-        recipeLevel = AbstractModelElement.getValueByName(node, "recipeLevel");
-        recipeInput = AbstractModelElement.getValueByName(node, "recipeInput");
-        String payload = AbstractModelElement.getValueByName(node, "recipePayload");
+        recipeInfo = JsonUtils.getStringValueByName(item, "recipeInfo");
+        recipeLevel = JsonUtils.getStringValueByName(item, "recipeLevel");
+        recipeInput = JsonUtils.getStringValueByName(item, "recipeInput");
+        String payload = JsonUtils.getStringValueByName(item, "recipePayload");
 
         if (payload != null && !payload.isEmpty()) {
             if (payload.trim().startsWith("{") && payload.trim().endsWith("}")) {
                 // Seems to be a JSON
-                recipePayload = JacksonUtils.getObjectMapperInstance().readValue(payload,
-                    new TypeReference<Map<String, String>>() {
-                    });
+                recipePayload = JsonUtils.GSON.fromJson(payload, new TypeToken<Map<String, String>>() {}.getType());
             } else {
                 // SHould be a YAML then
-                Yaml yaml = new Yaml();
-                recipePayload = (Map<String, String>) yaml.load(payload);
+                recipePayload = new Yaml().load(payload);
             }
         }
-        oapRop = AbstractModelElement.getValueByName(node, "oapRop");
-        oapLimit = AbstractModelElement.getValueByName(node, "oapLimit");
-        actor = AbstractModelElement.getValueByName(node, "actor");
+        oapRop = JsonUtils.getStringValueByName(item, "oapRop");
+        oapLimit = JsonUtils.getStringValueByName(item, "oapLimit");
+        actor = JsonUtils.getStringValueByName(item, "actor");
 
-        enableGuardPolicy = AbstractModelElement.getValueByName(node, "enableGuardPolicy");
-        guardPolicyType = AbstractModelElement.getValueByName(node, "guardPolicyType");
-        guardTargets = AbstractModelElement.getValueByName(node, "guardTargets");
-        minGuard = AbstractModelElement.getValueByName(node, "minGuard");
-        maxGuard = AbstractModelElement.getValueByName(node, "maxGuard");
-        limitGuard = AbstractModelElement.getValueByName(node, "limitGuard");
-        timeUnitsGuard = AbstractModelElement.getValueByName(node, "timeUnitsGuard");
-        timeWindowGuard = AbstractModelElement.getValueByName(node, "timeWindowGuard");
-        guardActiveStart = AbstractModelElement.getValueByName(node, "guardActiveStart");
-        guardActiveEnd = AbstractModelElement.getValueByName(node, "guardActiveEnd");
+        enableGuardPolicy = JsonUtils.getStringValueByName(item, "enableGuardPolicy");
+        guardPolicyType = JsonUtils.getStringValueByName(item, "guardPolicyType");
+        guardTargets = JsonUtils.getStringValueByName(item, "guardTargets");
+        minGuard = JsonUtils.getStringValueByName(item, "minGuard");
+        maxGuard = JsonUtils.getStringValueByName(item, "maxGuard");
+        limitGuard = JsonUtils.getStringValueByName(item, "limitGuard");
+        timeUnitsGuard = JsonUtils.getStringValueByName(item, "timeUnitsGuard");
+        timeWindowGuard = JsonUtils.getStringValueByName(item, "timeWindowGuard");
+        guardActiveStart = JsonUtils.getStringValueByName(item, "guardActiveStart");
+        guardActiveEnd = JsonUtils.getStringValueByName(item, "guardActiveEnd");
     }
 
     /**
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/Tca.java b/src/main/java/org/onap/clamp/clds/model/properties/Tca.java
index 7297ccb..5080822 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/Tca.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/Tca.java
@@ -25,7 +25,10 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import java.util.Map.Entry;
+import java.util.Set;
 
 /**
  * Parse ONAP Tca json properties.
@@ -47,12 +50,14 @@
      * @param modelBpmn
      * @param modelJson
      */
-    public Tca(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) {
+    public Tca(ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) {
         super(TYPE_TCA, modelProp, modelBpmn, modelJson);
 
         // process Server_Configurations
         if (modelElementJsonNode != null) {
-            tcaItem = new TcaItem(modelElementJsonNode.elements().next());
+            //this is wrong assumption that there is only one property object
+            Set<Entry<String, JsonElement>> entries = modelElementJsonNode.getAsJsonObject().entrySet();
+            tcaItem = new TcaItem(entries.iterator().next().getValue());
         }
     }
 
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java b/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java
index 3a4ea71..987b776 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/TcaItem.java
@@ -25,11 +25,13 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
 
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * Parse ONAP Tca Item json properties.
@@ -50,21 +52,23 @@
     /**
      * Parse Tca Item given json node
      *
-     * @param node
+     * @param tcaJson
      */
-    public TcaItem(JsonNode node) {
+    public TcaItem(JsonElement tcaJson) {
 
-        tcaName = AbstractModelElement.getValueByName(node, "tname");
-        tcaUuId = AbstractModelElement.getValueByName(node, "tuuid");
-        policyId = AbstractModelElement.getValueByName(node, "tcaPolId");
-        eventName = AbstractModelElement.getValueByName(node, "eventName");
-        controlLoopSchemaType = AbstractModelElement.getValueByName(node, "controlLoopSchemaType");
+        tcaName = JsonUtils.getStringValueByName(tcaJson, "tname");
+        tcaUuId = JsonUtils.getStringValueByName(tcaJson, "tuuid");
+        policyId = JsonUtils.getStringValueByName(tcaJson, "tcaPolId");
+        eventName = JsonUtils.getStringValueByName(tcaJson, "eventName");
+        controlLoopSchemaType = JsonUtils.getStringValueByName(tcaJson, "controlLoopSchemaType");
         // process service Configurations
-        JsonNode serviceConfigurationsNode = node.get(node.size() - 1).get("serviceConfigurations");
-        Iterator<JsonNode> itr = serviceConfigurationsNode.elements();
+        JsonArray tcaConfigurationArray = tcaJson.getAsJsonArray();
+        JsonArray serviceConfigurationsNode = tcaConfigurationArray.get(tcaConfigurationArray.size() - 1)
+            .getAsJsonObject().get("serviceConfigurations").getAsJsonArray();
+        Iterator<JsonElement> itr = serviceConfigurationsNode.iterator();
         tcaThresholds = new ArrayList<>();
         while (itr.hasNext()) {
-            tcaThresholds.add(new TcaThreshold(itr.next()));
+            tcaThresholds.add(new TcaThreshold(itr.next().getAsJsonArray()));
         }
     }
 
diff --git a/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java b/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java
index 05b8ae3..0903d72 100644
--- a/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java
+++ b/src/main/java/org/onap/clamp/clds/model/properties/TcaThreshold.java
@@ -25,7 +25,7 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
+import com.google.gson.JsonArray;
 
 /**
  * Parse ONAP Tca Threshold json properties.
@@ -44,21 +44,21 @@
     /**
      * Parse Tca Threshhold given json node
      *
-     * @param node
+     * @param tcaTresholdConfiguration
      */
-    public TcaThreshold(JsonNode node) {
+    public TcaThreshold(JsonArray tcaTresholdConfiguration) {
 
-        if (node.get(0) != null) {
-            fieldPath = node.get(0).asText();
+        if (tcaTresholdConfiguration.get(0) != null) {
+            fieldPath = tcaTresholdConfiguration.get(0).getAsString();
         }
-        if (node.get(1) != null) {
-            operator = node.get(1).asText();
+        if (tcaTresholdConfiguration.get(1) != null) {
+            operator = tcaTresholdConfiguration.get(1).getAsString();
         }
-        if (node.get(2) != null) {
-            threshold = Integer.valueOf(node.get(2).asText());
+        if (tcaTresholdConfiguration.get(2) != null) {
+            threshold = Integer.valueOf(tcaTresholdConfiguration.get(2).getAsString());
         }
-        if (node.get(3) != null) {
-            closedLoopEventStatus = node.get(3).asText();
+        if (tcaTresholdConfiguration.get(3) != null) {
+            closedLoopEventStatus = tcaTresholdConfiguration.get(3).getAsString();
         }
     }
 
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
index 382c1d7..94cffbb 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
@@ -25,8 +25,8 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -51,7 +51,7 @@
 import org.onap.clamp.clds.service.CldsService;
 import org.onap.clamp.clds.service.CldsTemplateService;
 import org.onap.clamp.clds.transform.XslTransformer;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.ApplicationContext;
@@ -59,9 +59,8 @@
 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.
+ * 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 {
 
@@ -103,7 +102,7 @@
         for (Entry<String, BlueprintArtifact> blueprint : csar.getMapOfBlueprints().entrySet()) {
             alreadyInstalled = alreadyInstalled
                 && (CldsModel.retrieve(cldsDao, buildModelName(csar, blueprint.getKey()), true).getId() != null) ? true
-                    : false;
+                : false;
         }
         return alreadyInstalled;
     }
@@ -165,22 +164,20 @@
         return listConfig.get(0);
     }
 
-    private static String getAllBlueprintParametersInJson(BlueprintArtifact blueprintArtifact) {
-        ObjectNode node = JacksonUtils.getObjectMapperInstance().createObjectNode();
+    String 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 defaultNode = ((Map<String, Object>) elem.getValue()).get("default");
-            if (defaultNode != null && defaultNode instanceof String) {
-                node.put(elem.getKey(), (String) defaultNode);
-            } else if (defaultNode != null) {
-                node.putPOJO(elem.getKey(), defaultNode);
+            Object defaultValue = ((Map<String, Object>) elem.getValue()).get("default");
+            if (defaultValue != null) {
+                addPropertyToNode(node, elem.getKey(), defaultValue);
             } else {
-                node.put(elem.getKey(), "");
+                node.addProperty(elem.getKey(), "");
             }
         });
-        node.put("policy_id", "AUTO_GENERATED_POLICY_ID_AT_SUBMIT");
+        node.addProperty("policy_id", "AUTO_GENERATED_POLICY_ID_AT_SUBMIT");
         return node.toString();
     }
 
@@ -217,14 +214,10 @@
     }
 
     /**
-     * This call must be done when deploying the SDC notification as this call get
-     * the latest version of the artifact (version can be specified to DCAE call)
+     * This call must be done when deploying the SDC notification as this call get the latest version of the artifact
+     * (version can be specified to DCAE call)
      *
-     * @param blueprintArtifact
      * @return The DcaeInventoryResponse object containing the dcae values
-     * @throws IOException
-     * @throws ParseException
-     * @throws InterruptedException
      */
     private DcaeInventoryResponse queryDcaeToGetServiceTypeId(BlueprintArtifact blueprintArtifact)
         throws IOException, ParseException, InterruptedException {
@@ -292,4 +285,18 @@
             + inputParams + "]}");
         return cldsModel.save(cldsDao, null);
     }
+
+    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/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index 206a424..2bad07f 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -26,11 +26,12 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
 import java.io.IOException;
+import java.lang.reflect.Type;
 import java.security.GeneralSecurityException;
 import java.util.Date;
 import java.util.List;
@@ -64,12 +65,11 @@
 import org.onap.clamp.clds.model.CldsTemplate;
 import org.onap.clamp.clds.model.DcaeEvent;
 import org.onap.clamp.clds.model.ValueItem;
-import org.onap.clamp.clds.model.properties.AbstractModelElement;
 import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.model.sdc.SdcServiceInfo;
 import org.onap.clamp.clds.sdc.controller.installer.CsarInstallerImpl;
 import org.onap.clamp.clds.transform.XslTransformer;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.clamp.clds.util.ONAPLogConstants;
 import org.slf4j.event.Level;
@@ -86,6 +86,8 @@
 @Component
 public class CldsService extends SecureServiceBase {
 
+    public static final Type LIST_OF_SDC_SERVICE_INFO_TYPE = new TypeToken<List<SdcServiceInfo>>() {
+    }.getType();
     @Produce(uri = "direct:processSubmit")
     private CamelProxy camelProxy;
     protected static final EELFLogger securityLogger = EELFManager.getInstance().getSecurityLogger();
@@ -333,7 +335,7 @@
      *
      * @param action
      * @param modelName
-     * @param validateFlag
+     * @param test
      * @param model
      * @return
      * @throws TransformerException
@@ -500,7 +502,7 @@
      *         In case of issues
      */
     public String getSdcProperties() throws IOException {
-        return ((ObjectNode) refProp.getJsonTemplate(GLOBAL_PROPERTIES_KEY)).toString();
+        return refProp.getJsonTemplate(GLOBAL_PROPERTIES_KEY).toString();
     }
 
     /**
@@ -581,21 +583,19 @@
         if (StringUtils.isBlank(responseStr)) {
             return "";
         }
-        ObjectMapper objectMapper = JacksonUtils.getObjectMapperInstance();
-        List<SdcServiceInfo> rawList = objectMapper.readValue(responseStr,
-            objectMapper.getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));
-        ObjectNode invariantIdServiceNode = objectMapper.createObjectNode();
-        ObjectNode serviceNode = objectMapper.createObjectNode();
+        List<SdcServiceInfo> rawList = JsonUtils.GSON.fromJson(responseStr, LIST_OF_SDC_SERVICE_INFO_TYPE);
+        JsonObject invariantIdServiceNode = new JsonObject();
+        JsonObject serviceNode = new JsonObject();
         logger.info("value of cldsserviceiNfolist: {}", rawList);
         if (rawList != null && !rawList.isEmpty()) {
             List<SdcServiceInfo> cldsSdcServiceInfoList = sdcCatalogServices.removeDuplicateServices(rawList);
             for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServiceInfoList) {
                 if (currCldsSdcServiceInfo != null) {
-                    invariantIdServiceNode.put(currCldsSdcServiceInfo.getInvariantUUID(),
+                    invariantIdServiceNode.addProperty(currCldsSdcServiceInfo.getInvariantUUID(),
                         currCldsSdcServiceInfo.getName());
                 }
             }
-            serviceNode.putPOJO("service", invariantIdServiceNode);
+            serviceNode.add("service", invariantIdServiceNode);
         }
         return serviceNode.toString();
     }
@@ -710,16 +710,17 @@
     }
 
     private void checkForDuplicateServiceVf(String modelName, String modelPropText) throws IOException {
-        JsonNode globalNode = JacksonUtils.getObjectMapperInstance().readTree(modelPropText).get("global");
-        String service = AbstractModelElement.getValueByName(globalNode, "service");
-        List<String> resourceVf = AbstractModelElement.getValuesByName(globalNode, "vf");
+        JsonElement globalNode = JsonUtils.GSON.fromJson(modelPropText, JsonObject.class).get("global");
+        String service = JsonUtils.getStringValueByName(globalNode, "service");
+        List<String> resourceVf = JsonUtils.getStringValuesByName(globalNode, "vf");
         if (service != null && resourceVf != null && !resourceVf.isEmpty()) {
             List<CldsModelProp> cldsModelPropList = cldsDao.getDeployedModelProperties();
             for (CldsModelProp cldsModelProp : cldsModelPropList) {
-                JsonNode currentNode = JacksonUtils.getObjectMapperInstance().readTree(cldsModelProp.getPropText())
+                JsonElement currentNode = JsonUtils.GSON
+                    .fromJson(cldsModelProp.getPropText(), JsonObject.class)
                     .get("global");
-                String currentService = AbstractModelElement.getValueByName(currentNode, "service");
-                List<String> currentVf = AbstractModelElement.getValuesByName(currentNode, "vf");
+                String currentService = JsonUtils.getStringValueByName(currentNode, "service");
+                List<String> currentVf = JsonUtils.getStringValuesByName(currentNode, "vf");
                 if (currentVf != null && !currentVf.isEmpty()) {
                     if (!modelName.equalsIgnoreCase(cldsModelProp.getName()) && service.equalsIgnoreCase(currentService)
                         && resourceVf.get(0).equalsIgnoreCase(currentVf.get(0))) {
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsUser.java b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
index b30397d..82b7727 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsUser.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
@@ -87,7 +87,7 @@
 
     /**
      * Sets the permissions.
-     * 
+     *
      * @param permissionsArray
      *            the permissions to set
      */
diff --git a/src/main/java/org/onap/clamp/clds/service/JacksonObjectMapperProvider.java b/src/main/java/org/onap/clamp/clds/service/JacksonObjectMapperProvider.java
deleted file mode 100644
index d6a4d2f..0000000
--- a/src/main/java/org/onap/clamp/clds/service/JacksonObjectMapperProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights
- *                             reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- * 
- */
-
-package org.onap.clamp.clds.service;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import javax.ws.rs.ext.ContextResolver;
-
-import org.onap.clamp.clds.util.JacksonUtils;
-
-/**
- * This class is to restrcit the class type that can be de-serialized.
- */
-public class JacksonObjectMapperProvider implements ContextResolver<ObjectMapper> {
-
-    private final ObjectMapper defaultObjectMapper;
-
-    public JacksonObjectMapperProvider() {
-        defaultObjectMapper = createDefaultMapper();
-    }
-
-    @Override
-    public ObjectMapper getContext(Class<?> type) {
-        return defaultObjectMapper;
-    }
-
-    private static ObjectMapper createDefaultMapper() {
-        return JacksonUtils.getObjectMapperInstance();
-    }
-}
diff --git a/src/main/java/org/onap/clamp/clds/service/SecureServicePermissionDeserializer.java b/src/main/java/org/onap/clamp/clds/service/SecureServicePermissionDeserializer.java
new file mode 100644
index 0000000..9cbf711
--- /dev/null
+++ b/src/main/java/org/onap/clamp/clds/service/SecureServicePermissionDeserializer.java
@@ -0,0 +1,45 @@
+/*-
+ * ============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.clds.service;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import java.lang.reflect.Type;
+
+public class SecureServicePermissionDeserializer implements JsonDeserializer<SecureServicePermission> {
+
+    @Override
+    public SecureServicePermission deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+        throws JsonParseException {
+        if (json.isJsonPrimitive()) {
+            return new SecureServicePermission(json.getAsString());
+        } else {
+            // if not string try default deserialization
+            return new Gson().fromJson(json, SecureServicePermission.class);
+        }
+    }
+}
diff --git a/src/main/java/org/onap/clamp/clds/util/JacksonUtils.java b/src/main/java/org/onap/clamp/clds/util/JacksonUtils.java
deleted file mode 100644
index 1f5419d..0000000
--- a/src/main/java/org/onap/clamp/clds/util/JacksonUtils.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights
- *                             reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); 
- * you may not use this file except in compliance with the License. 
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- * 
- */
-
-package org.onap.clamp.clds.util;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * This class is used to access the jackson with restricted type access.
- */
-public class JacksonUtils {
-
-    private static ObjectMapper objectMapper;
-
-    private JacksonUtils() {
-    }
-
-    /**
-     * Call this method to retrieve a secure ObjectMapper.
-     * 
-     * @return an ObjectMapper instance (same for clamp)
-     */
-    public static synchronized ObjectMapper getObjectMapperInstance() {
-        if (objectMapper == null) {
-            objectMapper = new ObjectMapper();
-            // This is to disable the security hole that could be opened for
-            // json deserialization, if needed do this
-            // objectMapper.enableDefaultTyping(DefaultTyping.NON_FINAL);
-            objectMapper.disableDefaultTyping();
-        }
-        return objectMapper;
-    }
-}
diff --git a/src/main/java/org/onap/clamp/clds/util/JsonUtils.java b/src/main/java/org/onap/clamp/clds/util/JsonUtils.java
new file mode 100644
index 0000000..96ddc29
--- /dev/null
+++ b/src/main/java/org/onap/clamp/clds/util/JsonUtils.java
@@ -0,0 +1,170 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.util;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.common.collect.Lists;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
+import org.onap.clamp.clds.model.properties.AbstractModelElement;
+import org.onap.clamp.clds.service.SecureServicePermission;
+import org.onap.clamp.clds.service.SecureServicePermissionDeserializer;
+
+/**
+ * This class is used to access the jackson with restricted type access.
+ */
+public class JsonUtils {
+
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractModelElement.class);
+    private static final String LOG_ELEMENT_NOT_FOUND = "Value '{}' for key 'name' not found in JSON";
+    private static final String LOG_ELEMENT_NOT_FOUND_IN_JSON = "Value '{}' for key 'name' not found in JSON {}";
+
+    public static final Gson GSON = new GsonBuilder()
+        .registerTypeAdapter(SecureServicePermission.class, new SecureServicePermissionDeserializer())
+        .create();
+
+    private JsonUtils() {
+    }
+
+
+    /**
+     * Return the value field of the json node element that has a name field equals to the given name.
+     */
+    public static String getStringValueByName(JsonElement jsonElement, String name) {
+        String value = extractJsonValueFromElement(jsonElement, name)
+            .map(JsonUtils::extractStringValueFromElement)
+            .orElse(null);
+        if (value == null) {
+            if (logger.isDebugEnabled()) {
+                logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, jsonElement.toString());
+            } else {
+                logger.warn(LOG_ELEMENT_NOT_FOUND, name);
+            }
+        }
+        return value;
+    }
+
+    /**
+     * Return an array of values for the field of the json node element that has a name field equals to the given name.
+     */
+    public static List<String> getStringValuesByName(JsonElement jsonElement, String name) {
+        List<String> values = extractJsonValueFromElement(jsonElement, name)
+            .map(JsonUtils::extractStringValuesFromElement).orElse(new ArrayList<>());
+        if (values.isEmpty()) {
+            if (logger.isDebugEnabled()) {
+                logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, jsonElement.toString());
+            } else {
+                logger.warn(LOG_ELEMENT_NOT_FOUND, name);
+            }
+        }
+        return values;
+    }
+
+    /**
+     * Return the int value field of the json node element that has a name field equals to the given name.
+     */
+    public static Integer getIntValueByName(JsonElement element, String name) {
+        String value = getStringValueByName(element, name);
+        return Integer.valueOf(value);
+    }
+
+
+    /**
+     * Return the Json value field of the json node element that has a name field equals to the given name.
+     */
+    public static JsonObject getJsonObjectByName(JsonElement jsonElement, String name) {
+        JsonObject jsonObject = extractJsonValueFromElement(jsonElement, name).map(JsonElement::getAsJsonObject)
+            .orElse(null);
+        if (jsonObject  == null) {
+            logger.warn(LOG_ELEMENT_NOT_FOUND, name);
+        } else {
+            logger.debug(LOG_ELEMENT_NOT_FOUND_IN_JSON, name, jsonElement.toString());
+        }
+        return jsonObject;
+    }
+
+    private static Optional<JsonElement> extractJsonValueFromElement(JsonElement jsonElement, String name) {
+        if(jsonElement != null ){
+            if (jsonElement.isJsonArray()) {
+                return extractValueJsonFromArray(jsonElement, name);
+            } else if (hasMatchingParameterName(name, jsonElement)) {
+                return Optional.of(jsonElement);
+            }
+        }
+        return Optional.empty();
+    }
+
+    private static Optional<JsonElement> extractValueJsonFromArray(JsonElement jsonElement, String name) {
+        for (JsonElement element : jsonElement.getAsJsonArray()) {
+            if (hasMatchingParameterName(name, element)) {
+                return Optional.of(element.getAsJsonObject().get("value"));
+            }
+        }
+        return Optional.empty();
+    }
+
+    private static boolean hasMatchingParameterName(String name, JsonElement element) {
+        return element.isJsonObject()
+            && element.getAsJsonObject().has("name")
+            && name.equals(element.getAsJsonObject().get("name").getAsString());
+    }
+
+    private static String extractStringValueFromElement(JsonElement element) {
+        if (element.isJsonArray()) {
+            return element.getAsJsonArray().get(0).getAsString();
+        } else if (element.isJsonPrimitive()) {
+            return element.getAsJsonPrimitive().getAsString();
+        } else {
+            return GSON.toJson(element);
+        }
+    }
+
+    private static List<String> extractStringValuesFromElement(JsonElement element) {
+        if (element.isJsonArray()) {
+            return StreamSupport.stream(
+                Spliterators.spliteratorUnknownSize(element.getAsJsonArray().iterator(), Spliterator.ORDERED),
+                false)
+                .filter(JsonElement::isJsonPrimitive)
+                .map(JsonElement::getAsJsonPrimitive)
+                .filter(JsonPrimitive::isString)
+                .map(JsonPrimitive::getAsString)
+                .collect(Collectors.toList());
+        } else {
+            String value = extractStringValueFromElement(element);
+            return Lists.newArrayList(value);
+        }
+
+    }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index c492f74..91a4cab 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -73,6 +73,7 @@
 server.servlet.context-path=/
 #Modified engine-rest applicationpath
 spring.profiles.active=clamp-default,clamp-aaf-authentication,clamp-sdc-controller
+spring.http.converters.preferred-json-mapper=gson
 
 #The max number of active threads in this pool
 server.tomcat.max-threads=200
diff --git a/src/test/java/org/onap/clamp/clds/client/DcaeDispatcherServicesTest.java b/src/test/java/org/onap/clamp/clds/client/DcaeDispatcherServicesTest.java
index c828f78..1b01f54 100644
--- a/src/test/java/org/onap/clamp/clds/client/DcaeDispatcherServicesTest.java
+++ b/src/test/java/org/onap/clamp/clds/client/DcaeDispatcherServicesTest.java
@@ -23,9 +23,8 @@
 
 package org.onap.clamp.clds.client;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.ImmutableMap;
+import com.google.gson.JsonObject;
 import java.io.IOException;
 import org.assertj.core.api.Assertions;
 import org.junit.Before;
@@ -61,9 +60,13 @@
     @InjectMocks
     DcaeDispatcherServices dcaeDispatcherServices;
 
-    private final String STATUS_RESPONSE_PROCESSING = "{\"operationType\": \"deploy\",\"status\": \"processing\"}";
-    private final String STATUS_RESPONSE_ACTIVE = "{\"operationType\": \"deploy\",\"status\": \"succeeded\"}";
+    private static final String STATUS_RESPONSE_PROCESSING = "{\"operationType\": \"deploy\","
+        + "\"status\": \"processing\"}";
+    private static final String STATUS_RESPONSE_ACTIVE = "{\"operationType\": \"deploy\",\"status\": \"succeeded\"}";
 
+    /**
+     * Setup method.
+     */
     @Before
     public void setUp() {
         ImmutableMap.<String, String>builder()
@@ -126,10 +129,10 @@
     @Test
     public void shouldTriggerDeploymentCreation() throws IOException {
         //given
-        String deploymentID = "closedLoop_152367c8-b172-47b3-9e58-c53add75d869_deploymentId";
+        String deploymentId = "closedLoop_152367c8-b172-47b3-9e58-c53add75d869_deploymentId";
         String serviceTypeId = "e2ba40f7-bf42-41e7-acd7-48fd07586d90";
         Mockito.when(clampProperties.getJsonTemplate("dcae.deployment.template"))
-                .thenReturn(new ObjectMapper().readTree("{}"));
+                .thenReturn(new JsonObject());
 
         Mockito.when(dcaeHttpConnectionManager
                 .doDcaeHttpQuery(DCAE_URL
@@ -138,11 +141,11 @@
                         "{\"serviceTypeId\":\"e2ba40f7-bf42-41e7-acd7-48fd07586d90\",\"inputs\":{}}",
                         "application/json"))
                 .thenReturn(DEPLOY_RESPONSE_STRING);
-        JsonNode blueprintInputJson = new ObjectMapper().readTree("{}");
+        JsonObject blueprintInputJson = new JsonObject();
 
         //when
         String operationStatus = dcaeDispatcherServices
-                .createNewDeployment(deploymentID, serviceTypeId, blueprintInputJson);
+                .createNewDeployment(deploymentId, serviceTypeId, blueprintInputJson);
 
         //then
         Assertions.assertThat(operationStatus).isEqualTo("http://deployment-handler.onap:8443/"
diff --git a/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java b/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java
index f163456..3178580 100644
--- a/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java
+++ b/src/test/java/org/onap/clamp/clds/client/req/policy/GuardPolicyAttributesConstructorTest.java
@@ -44,6 +44,9 @@
     private ModelProperties modelProperties;
     private List<PolicyChain> policyChains;
 
+    /**
+     * @throws Exception thrown if resources not found.
+     */
     @Before
     public void setUp() throws Exception {
         String modelProp = ResourceFileUtil
diff --git a/src/test/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyAttributesConstructorTest.java b/src/test/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyAttributesConstructorTest.java
index 293f0e6..4d78cf8 100644
--- a/src/test/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyAttributesConstructorTest.java
+++ b/src/test/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyAttributesConstructorTest.java
@@ -23,14 +23,11 @@
 
 package org.onap.clamp.clds.client.req.policy;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.ImmutableMap;
-
+import com.google.gson.JsonElement;
 import java.io.IOException;
 import java.net.URLDecoder;
 import java.util.Map;
-
 import org.assertj.core.api.Assertions;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,6 +36,7 @@
 import org.onap.clamp.clds.config.ClampProperties;
 import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.model.properties.PolicyChain;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.policy.api.AttributeType;
 import org.onap.policy.controlloop.policy.ControlLoopPolicy;
@@ -54,6 +52,9 @@
     private ModelProperties modelProperties;
     private PolicyChain policyChain;
 
+    /**
+     * @throws Exception thrown if resource not found.
+     */
     @Before
     public void setUp() throws Exception {
         String modelProp = ResourceFileUtil
@@ -140,7 +141,7 @@
     private PolicyChain readPolicyChainFromResources() throws IOException {
         String policyChainText = ResourceFileUtil
             .getResourceAsString("example/operational-policy/json-policy-chain.json");
-        JsonNode policyChainNode = new ObjectMapper().readTree(policyChainText);
+        JsonElement policyChainNode = JsonUtils.GSON.fromJson(policyChainText, JsonElement.class);
         return new PolicyChain(policyChainNode);
     }
 }
diff --git a/src/test/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatterTest.java b/src/test/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatterTest.java
new file mode 100644
index 0000000..095df9d
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatterTest.java
@@ -0,0 +1,98 @@
+/*-
+ * ============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.clds.client.req.tca;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import com.google.gson.JsonObject;
+import java.io.IOException;
+import org.junit.Test;
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
+import org.onap.clamp.clds.model.properties.TcaItem;
+import org.onap.clamp.clds.util.JsonUtils;
+
+public class TcaRequestFormatterTest {
+
+    private static final String TCA_POLICY_PROPERTIES_TEMPLATE = "{"
+        + " \"domain\": \"measurementsForVfScaling\","
+        + " \"metricsPerEventName\": ["
+        + "  {"
+        + "   \"eventName\": \"???\","
+        + "   \"controlLoopSchemaType\": \"VNF\","
+        + "   \"policyScope\": \"DCAE\","
+        + "   \"policyName\": \"???\","
+        + "   \"policyVersion\": \"v0.0.1\","
+        + "   \"thresholds\": ["
+        + "   ]"
+        + "  }"
+        + " ]"
+        + "}";
+
+    @Test
+    public void shouldReturnFormattedTcaPolicyRequest() throws IOException {
+        //given
+        String service = "TestService";
+        String policy = "TestService_scope.PolicyName";
+        ClampProperties clampProperties = mock(ClampProperties.class);
+        String expectedRequestText = 
+            "{ "
+            + " \"domain\": \"measurementsForVfScaling\", "
+            + " \"metricsPerEventName\": [ "
+            + "  { "
+            + "   \"eventName\": \"vLoadBalancer\", "
+            + "   \"controlLoopSchemaType\": \"VNF\", "
+            + "   \"policyScope\": \"DCAE\", "
+            + "   \"policyName\": \"TestService_scope.PolicyName\", "
+            + "   \"policyVersion\": \"v0.0.1\", "
+            + "   \"thresholds\": [] "
+            + "  } "
+            + " ] "
+            + "}";
+    
+        JsonObject tcaPolicyPropertiesTemplate = JsonUtils.GSON
+            .fromJson(TCA_POLICY_PROPERTIES_TEMPLATE, JsonObject.class);
+
+        JsonObject expectedRequest = JsonUtils.GSON.fromJson(expectedRequestText, JsonObject.class);
+
+        ModelProperties modelProperties = mock(ModelProperties.class);
+        Tca tca = mock(Tca.class);
+        TcaItem tcaItem = mock(TcaItem.class);
+        when(clampProperties.getJsonTemplate(any(), any())).thenReturn(tcaPolicyPropertiesTemplate);
+        when(tca.getTcaItem()).thenReturn(tcaItem);
+        when(tcaItem.getEventName()).thenReturn("vLoadBalancer");
+        when(tcaItem.getControlLoopSchemaType()).thenReturn("VNF");
+
+        //when
+        JsonObject policyContent = TcaRequestFormatter
+            .createPolicyContent(clampProperties, modelProperties, service, policy, tca);
+
+        //then
+        assertThat(expectedRequest).isEqualTo(policyContent);
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java b/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
index c04357d..a32a603 100644
--- a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java
@@ -25,10 +25,7 @@
 package org.onap.clamp.clds.config;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
 
-import java.util.Collections;
 import org.junit.Test;
 import org.onap.clamp.clds.service.CldsUser;
 
diff --git a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
index 3f0a078..d27690b 100644
--- a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
@@ -29,13 +29,13 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
+import com.google.gson.JsonObject;
 import java.io.IOException;
-
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import org.junit.Test;
 import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 
 /**
@@ -43,13 +43,19 @@
  */
 public class SdcSingleControllerConfigurationTest {
 
+    /**
+     * @param fileName file for sdc controller configuration.
+     * @param sdcControllerName sdc controller name.
+     * @return instance of SdcSingleControllerConfiguration.
+     */
     public static SdcSingleControllerConfiguration loadControllerConfiguration(String fileName,
-        String sdcControllerName) throws IOException {
-        JsonNode jsonNode = new ObjectMapper().readValue(ResourceFileUtil.getResourceAsStream(fileName),
-            JsonNode.class);
-        SdcSingleControllerConfiguration sdcSingleControllerConfiguration = new SdcSingleControllerConfiguration(
-            jsonNode, sdcControllerName);
-        return sdcSingleControllerConfiguration;
+        String sdcControllerName) {
+
+        InputStreamReader streamReader = new InputStreamReader(ResourceFileUtil.getResourceAsStream(fileName),
+            StandardCharsets.UTF_8);
+        JsonObject jsonNode = JsonUtils.GSON.fromJson(streamReader, JsonObject.class);
+
+        return new SdcSingleControllerConfiguration(jsonNode, sdcControllerName);
     }
 
     @Test
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
index 85218ab..6ab800b 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
@@ -160,7 +160,7 @@
     }
 
     @Test
-    public void testGetCLDSDetails() throws IOException {
+    public void testGetCldsDetails() throws IOException {
         List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsService.getCldsDetails();
         assertNotNull(cldsMonitoringDetailsList);
     }
diff --git a/src/test/java/org/onap/clamp/clds/it/DcaeHttpConnectionManagerItCase.java b/src/test/java/org/onap/clamp/clds/it/DcaeHttpConnectionManagerItCase.java
index 12e8dd9..8e03153 100644
--- a/src/test/java/org/onap/clamp/clds/it/DcaeHttpConnectionManagerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/DcaeHttpConnectionManagerItCase.java
@@ -69,22 +69,22 @@
     @Autowired
     DcaeHttpConnectionManager dcaeHttpConnectionManager;
 
-    private static TrustManager[] trustAllCerts = new TrustManager[] {
-            new X509TrustManager() {
+    private static TrustManager[] trustAllCerts = new TrustManager[]{
+        new X509TrustManager() {
 
-                @Override
-                public java.security.cert.X509Certificate[] getAcceptedIssuers() {
-                    return null;
-                }
-
-                @Override
-                public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
-                }
-
-                @Override
-                public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
-                }
+            @Override
+            public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+                return null;
             }
+
+            @Override
+            public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
+            }
+
+            @Override
+            public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
+            }
+        }
     };
 
     private void enableSslNoCheck() throws NoSuchAlgorithmException, KeyManagementException {
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
index 31594cb..3acc439 100644
--- a/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/PolicyClientItCase.java
@@ -24,7 +24,9 @@
 
 package org.onap.clamp.clds.it;
 
+import com.google.gson.reflect.TypeToken;
 import java.io.IOException;
+import java.lang.reflect.Type;
 import java.util.List;
 import java.util.Map;
 
@@ -47,7 +49,7 @@
 import org.onap.clamp.clds.model.properties.PolicyItem;
 import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.transform.XslTransformer;
-import org.onap.clamp.clds.util.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.policy.api.AttributeType;
@@ -67,6 +69,8 @@
 @SpringBootTest
 public class PolicyClientItCase {
 
+    private static final Type MAP_OF_STRING_TO_OBJECT_TYPE = new TypeToken<Map<String, Object>>() {}.getType();
+
     @Autowired
     private CldsDao cldsDao;
     @Autowired
@@ -82,6 +86,11 @@
     String modelBpmnPropJson;
     ModelProperties prop;
 
+    /**
+     * Setup method.
+     * @throws IOException thrown if resources not found
+     * @throws TransformerException thrown if invalid xml given to transformation
+     */
     @Before
     public void setUp() throws IOException, TransformerException {
         modelProp = ResourceFileUtil.getResourceAsString("example/model-properties/tca_new/model-properties.json");
@@ -94,7 +103,7 @@
     }
 
     @Test
-    public void testSendGuardPolicy() throws TransformerException, IOException {
+    public void testSendGuardPolicy() {
         // Normally there is only one Guard
         List<PolicyItem> policyItems = GuardPolicyAttributesConstructor
             .getAllPolicyGuardsFromPolicyChain(prop.getType(Policy.class).getPolicyChains().get(0));
@@ -105,8 +114,7 @@
         String response = policyClient.sendGuardPolicy(
             GuardPolicyAttributesConstructor.formatAttributes(prop, policyItem), prop, LoggingUtils.getRequestId(),
             policyItem);
-        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Map<String, Object> mapNodes = JsonUtils.GSON.fromJson(response, MAP_OF_STRING_TO_OBJECT_TYPE);
         Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Decision"),
             Assertions.entry("policyName",
                 modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0_Guard_6TtHGPq"),
@@ -124,14 +132,13 @@
     }
 
     @Test
-    public void testSendBrmsPolicy()
-        throws TransformerException, BuilderException, IllegalArgumentException, IOException {
+    public void testSendBrmsPolicy() throws BuilderException, IllegalArgumentException, IOException {
         Map<AttributeType, Map<String, String>> attributes = OperationalPolicyAttributesConstructor.formatAttributes(
             refProp, prop, prop.getType(Policy.class).getId(), prop.getType(Policy.class).getPolicyChains().get(0));
         String response = policyClient.sendBrmsPolicy(attributes, prop, LoggingUtils.getRequestId());
 
-        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Map<String, Object> mapNodes = JsonUtils.GSON.fromJson(response, MAP_OF_STRING_TO_OBJECT_TYPE);
+
         Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
             Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0"),
             Assertions.entry("policyConfigType", PolicyConfigType.BRMS_PARAM.name()),
@@ -144,14 +151,13 @@
     }
 
     @Test
-    public void testSendMicroServiceInJson()
-        throws TransformerException, BuilderException, IllegalArgumentException, IOException {
+    public void testSendMicroServiceInJson() throws IllegalArgumentException {
         prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
         String jsonToSend = "{\"test\":\"test\"}";
         String response = policyClient.sendMicroServiceInJson(jsonToSend, prop, LoggingUtils.getRequestId());
 
-        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Map<String, Object> mapNodes = JsonUtils.GSON.fromJson(response, MAP_OF_STRING_TO_OBJECT_TYPE);
+
         Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
             Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h"),
             Assertions.entry("policyConfigType", PolicyConfigType.MicroService.name()),
@@ -165,8 +171,8 @@
     public void testSendBasePolicyInOther() throws IllegalArgumentException, IOException {
         String body = "test";
         String response = policyClient.sendBasePolicyInOther(body, "myPolicy", prop, LoggingUtils.getRequestId());
-        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Map<String, Object> mapNodes = JsonUtils.GSON.fromJson(response, MAP_OF_STRING_TO_OBJECT_TYPE);
+
         Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
             Assertions.entry("policyName", "myPolicy"),
             Assertions.entry("policyConfigType", PolicyConfigType.Base.name()),
@@ -181,8 +187,8 @@
         String tcaJson = TcaRequestFormatter.createPolicyJson(refProp, prop);
         String response = policyClient.sendMicroServiceInOther(tcaJson, prop);
 
-        Map<String, Object> mapNodes = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(response), Map.class);
+        Map<String, Object> mapNodes = JsonUtils.GSON.fromJson(response, MAP_OF_STRING_TO_OBJECT_TYPE);
+
         Assertions.assertThat(mapNodes).contains(Assertions.entry("policyClass", "Config"),
             Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_TCA_1d13unw"),
             Assertions.entry("policyConfigType", PolicyConfigType.MicroService.name()),
@@ -196,10 +202,10 @@
         String[] responses = policyClient.deleteMicrosService(prop).split("\\}\\{");
 
         // There are 2 responses appended to the result, one for PDP one for PAP !
-        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
-        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+        Map<String, Object> mapNodesPdp = JsonUtils.GSON.fromJson(responses[0] + "}",
+            MAP_OF_STRING_TO_OBJECT_TYPE);
+        Map<String, Object> mapNodesPap = JsonUtils.GSON.fromJson("{" + responses[1],
+            MAP_OF_STRING_TO_OBJECT_TYPE);
 
         Assertions.assertThat(mapNodesPdp).contains(
             Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_TCA_1d13unw"),
@@ -221,11 +227,10 @@
         prop.setGuardUniqueId(policyItems.get(0).getId());
         String[] responses = policyClient.deleteGuard(prop).split("\\}\\{");
 
-        // There are 2 responses appended to the result, one for PDP one for PAP !
-        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
-        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+        Map<String, Object> mapNodesPdp = JsonUtils.GSON.fromJson(responses[0] + "}",
+            MAP_OF_STRING_TO_OBJECT_TYPE);
+        Map<String, Object> mapNodesPap = JsonUtils.GSON.fromJson("{" + responses[1],
+            MAP_OF_STRING_TO_OBJECT_TYPE);
 
         Assertions.assertThat(mapNodesPdp).contains(
             Assertions.entry("policyName",
@@ -245,11 +250,10 @@
         prop.setCurrentModelElementId(prop.getType(Policy.class).getId());
         String[] responses = policyClient.deleteBrms(prop).split("\\}\\{");
 
-        // There are 2 responses appended to the result, one for PDP one for PAP !
-        Map<String, Object> mapNodesPdp = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree(responses[0] + "}"), Map.class);
-        Map<String, Object> mapNodesPap = JacksonUtils.getObjectMapperInstance()
-            .convertValue(JacksonUtils.getObjectMapperInstance().readTree("{" + responses[1]), Map.class);
+        Map<String, Object> mapNodesPdp = JsonUtils.GSON.fromJson(responses[0] + "}",
+            MAP_OF_STRING_TO_OBJECT_TYPE);
+        Map<String, Object> mapNodesPap = JsonUtils.GSON.fromJson("{" + responses[1],
+            MAP_OF_STRING_TO_OBJECT_TYPE);
 
         Assertions.assertThat(mapNodesPdp).contains(
             Assertions.entry("policyName", modelName.replace("-", "_") + "." + controlName + "_Policy_12lup3h_0"),
@@ -273,7 +277,8 @@
         String tosca = policyClient.importToscaModel(cldsToscaModel);
 
         Assertions.assertThat(tosca).contains(
-            "{\"serviceName\":\"tca-policy-test\",\"description\":\"tca-policy-test\",\"requestID\":null,\"filePath\":\"/tmp/tosca-models/tca-policy-test.yml\",");
+            "{\"serviceName\":\"tca-policy-test\",\"description\":\"tca-policy-test\","
+                + "\"requestID\":null,\"filePath\":\"/tmp/tosca-models/tca-policy-test.yml\",");
         Assertions.assertThat(tosca).contains(toscaModelYaml);
     }
 }
diff --git a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
index 9d58ba8..630e8c0 100644
--- a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
@@ -28,8 +28,8 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
+import com.google.gson.JsonElement;
 import java.io.IOException;
 import java.util.List;
 
@@ -62,24 +62,34 @@
         assertNull(refProp.getStringValue("does.not.exist"));
     }
 
-    /**
-     * Test getting prop value as a JSON Node / template.
-     *
-     * @throws IOException
-     *         when JSON parsing fails
-     */
     @Test
-    public void testGetJsonTemplate() throws IOException {
-        // ui.location.default={"DC1":"Data Center 1","DC2":"Data Center
-        // 2","DC3":"Data Center 3"}
-        ObjectNode root = (ObjectNode) refProp.getJsonTemplate("ui.location.default");
+    public void shouldReturnJsonFromTemplate() throws IOException {
+        //when
+        JsonElement root = refProp.getJsonTemplate("ui.location.default");
+
+        //then
         assertNotNull(root);
-        assertEquals(root.get("DC1").asText(), "Data Center 1");
-        // Test composite key
-        root = (ObjectNode) refProp.getJsonTemplate("ui.location", "default");
+        assertTrue(root.isJsonObject());
+        assertEquals(root.getAsJsonObject().get("DC1").getAsString(), "Data Center 1");
+    }
+
+    @Test
+    public void shouldReturnJsonFromTemplate_2() throws IOException {
+        //when
+        JsonElement root = refProp.getJsonTemplate("ui.location", "default");
+
+        //then
         assertNotNull(root);
-        assertEquals(root.get("DC1").asText(), "Data Center 1");
-        root = (ObjectNode) refProp.getJsonTemplate("ui.location", "");
+        assertTrue(root.isJsonObject());
+        assertEquals(root.getAsJsonObject().get("DC1").getAsString(), "Data Center 1");
+    }
+
+    @Test
+    public void shouldReturnNullIfPropertyNotFound() throws IOException {
+        //when
+        JsonElement root = refProp.getJsonTemplate("ui.location", "");
+
+        //then
         assertNull(root);
     }
 
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 0cab4b9..8fd817c 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
@@ -24,6 +24,7 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import com.google.gson.JsonSyntaxException;
 import java.io.IOException;
 import java.util.Map;
 
@@ -71,7 +72,7 @@
             sdcControllersConfiguration.getSdcSingleControllerConfiguration("sdc-controller2").getSdcControllerName());
     }
 
-    @Test(expected = IOException.class)
+    @Test(expected = JsonSyntaxException.class)
     public void testBadJsonLoading() throws IOException {
         loadFile("classpath:/clds/sdc-controllers-config-bad.json");
         fail("Should have raised an exception");
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 9eaca5f..c6dbce4 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
@@ -23,7 +23,6 @@
 
 package org.onap.clamp.clds.it.sdc.controller;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -89,8 +88,11 @@
         return notifData;
     }
 
+    /**
+     * Initialization method.
+     */
     @Before
-    public void init() throws IOException {
+    public void init() {
         sdcSingleController = new SdcSingleController(clampProp, Mockito.mock(CsarInstaller.class),
             SdcSingleControllerConfigurationTest.loadControllerConfiguration("clds/sdc-controller-config-TLS.json",
                 "sdc-controller1"),
diff --git a/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
index 7d3a215..871d0a6 100644
--- a/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
+++ b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
@@ -18,16 +18,16 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.model.prop;
 
-import com.fasterxml.jackson.databind.JsonNode;
-
+import com.google.gson.JsonObject;
 import org.onap.clamp.clds.model.properties.AbstractModelElement;
 import org.onap.clamp.clds.model.properties.ModelBpmn;
 import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.util.JsonUtils;
 
 /**
  * A CustomModelElement to test the capability to add new elements on the fly.
@@ -40,10 +40,10 @@
     /**
      * Main Constructor.
      */
-    public CustomModelElement(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) {
+    public CustomModelElement(ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) {
         super(CUSTOM_TYPE, modelProp, modelBpmn, modelJson);
-        topicPublishes = getValueByName("topicPublishes");
-        test = this.getValueByName("test");
+        topicPublishes = JsonUtils.getStringValueByName(modelElementJsonNode, "topicPublishes");
+        test = JsonUtils.getStringValueByName(modelElementJsonNode, "test");
     }
 
     public static final String getType() {
diff --git a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
index 295ccc5..4195f90 100644
--- a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
@@ -23,6 +23,7 @@
 
 package org.onap.clamp.clds.model.prop;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -36,6 +37,7 @@
 import org.onap.clamp.clds.model.properties.Holmes;
 import org.onap.clamp.clds.model.properties.ModelProperties;
 import org.onap.clamp.clds.model.properties.Policy;
+import org.onap.clamp.clds.model.properties.PolicyItem;
 import org.onap.clamp.clds.model.properties.Tca;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 
@@ -61,11 +63,12 @@
         assertEquals(1, policy.getPolicyChains().size());
         assertEquals("0", policy.getPolicyChains().get(0).getPolicyId());
         assertEquals(1, policy.getPolicyChains().get(0).getPolicyItems().size());
-        assertEquals("resourceid", policy.getPolicyChains().get(0).getPolicyItems().get(0).getTargetResourceId());
-        assertEquals(180, policy.getPolicyChains().get(0).getPolicyItems().get(0).getRetryTimeLimit());
-        assertEquals(3, policy.getPolicyChains().get(0).getPolicyItems().get(0).getMaxRetries());
-        assertEquals("", policy.getPolicyChains().get(0).getPolicyItems().get(0).getParentPolicy());
-        assertEquals(null, policy.getPolicyChains().get(0).getPolicyItems().get(0).getParentPolicyConditions());
+        PolicyItem firstPolicyItem = policy.getPolicyChains().get(0).getPolicyItems().get(0);
+        assertEquals("resourceid", firstPolicyItem.getTargetResourceId());
+        assertEquals(180, firstPolicyItem.getRetryTimeLimit());
+        assertEquals(3, firstPolicyItem.getMaxRetries());
+        assertEquals("", firstPolicyItem.getParentPolicy());
+        assertThat(firstPolicyItem.getParentPolicyConditions()).isEmpty();
         Tca tca = prop.getType(Tca.class);
         assertNotNull(tca);
         assertTrue(tca.isFound());
@@ -91,8 +94,8 @@
             prop.getGlobal().getResourceVf().toArray()));
         assertTrue(Arrays.equals(new String[] { "SNDGCA64", "ALPRGAED", "LSLEILAA", "MDTWNJC1" },
             prop.getGlobal().getLocation().toArray()));
-        assertEquals("value1", prop.getGlobal().getDeployParameters().get("input1").asText());
-        assertEquals("value2", prop.getGlobal().getDeployParameters().get("input2").asText());
+        assertEquals("value1", prop.getGlobal().getDeployParameters().get("input1").getAsString());
+        assertEquals("value2", prop.getGlobal().getDeployParameters().get("input2").getAsString());
     }
 
     @Test
@@ -107,11 +110,12 @@
         assertEquals(1, policy.getPolicyChains().size());
         assertEquals("0", policy.getPolicyChains().get(0).getPolicyId());
         assertEquals(1, policy.getPolicyChains().get(0).getPolicyItems().size());
-        assertEquals("resourceid", policy.getPolicyChains().get(0).getPolicyItems().get(0).getTargetResourceId());
-        assertEquals(180, policy.getPolicyChains().get(0).getPolicyItems().get(0).getRetryTimeLimit());
-        assertEquals(3, policy.getPolicyChains().get(0).getPolicyItems().get(0).getMaxRetries());
-        assertEquals("", policy.getPolicyChains().get(0).getPolicyItems().get(0).getParentPolicy());
-        assertEquals(null, policy.getPolicyChains().get(0).getPolicyItems().get(0).getParentPolicyConditions());
+        PolicyItem firstPolicyItem = policy.getPolicyChains().get(0).getPolicyItems().get(0);
+        assertEquals("resourceid", firstPolicyItem.getTargetResourceId());
+        assertEquals(180, firstPolicyItem.getRetryTimeLimit());
+        assertEquals(3, firstPolicyItem.getMaxRetries());
+        assertEquals("", firstPolicyItem.getParentPolicy());
+        assertThat(firstPolicyItem.getParentPolicyConditions()).isEmpty();
         Holmes holmes = prop.getType(Holmes.class);
         assertNotNull(holmes);
         assertTrue(holmes.isFound());
@@ -124,8 +128,8 @@
             prop.getGlobal().getResourceVf().toArray()));
         assertTrue(Arrays.equals(new String[] { "SNDGCA64", "ALPRGAED", "LSLEILAA", "MDTWNJC1" },
             prop.getGlobal().getLocation().toArray()));
-        assertEquals("value1", prop.getGlobal().getDeployParameters().get("input1").asText());
-        assertEquals("value2", prop.getGlobal().getDeployParameters().get("input2").asText());
+        assertEquals("value1", prop.getGlobal().getDeployParameters().get("input1").getAsString());
+        assertEquals("value2", prop.getGlobal().getDeployParameters().get("input2").getAsString());
     }
 
     @Test
diff --git a/src/test/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfoTest.java b/src/test/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfoTest.java
index 119fd21..5adb064 100644
--- a/src/test/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfoTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/sdc/SdcResourceBasicInfoTest.java
@@ -31,15 +31,17 @@
     @Test
     public void testHashCode() {
         SdcResourceBasicInfo sdc1a = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc1a.setName("test1");
         sdc1a.setVersion("1.0");
-        sdc1b.setName("test1");
-        sdc1b.setVersion("2.0");
+
+        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc2.setName("test2");
         sdc2.setVersion("2.0");
 
+        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
+        sdc1b.setName("test1");
+        sdc1b.setVersion("2.0");
+
         Assertions.assertThat(sdc1a.hashCode()).isNotEqualTo(sdc1b.hashCode());
         Assertions.assertThat(sdc1b.hashCode()).isNotEqualTo(sdc2.hashCode());
         sdc1b.setVersion("1.0");
@@ -50,12 +52,14 @@
     @Test
     public void testCompareTo() {
         SdcResourceBasicInfo sdc1a = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc1a.setName("test1");
         sdc1a.setVersion("1.0");
+
+        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
         sdc1b.setName("test1");
         sdc1b.setVersion("2.0");
+
+        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc2.setName("test2");
         sdc2.setVersion("2.0");
 
@@ -68,12 +72,14 @@
     @Test
     public void testEquals() {
         SdcResourceBasicInfo sdc1a = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
-        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc1a.setName("test1");
         sdc1a.setVersion("1.0");
+
+        SdcResourceBasicInfo sdc1b = new SdcResourceBasicInfo();
         sdc1b.setName("test1");
         sdc1b.setVersion("2.0");
+
+        SdcResourceBasicInfo sdc2 = new SdcResourceBasicInfo();
         sdc2.setName("test2");
         sdc2.setVersion("2.0");
 
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java
new file mode 100644
index 0000000..a995c52
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImplTest.java
@@ -0,0 +1,66 @@
+/*-
+ * ============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.clds.sdc.controller.installer;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+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;
+
+public class CsarInstallerImplTest {
+
+    @Test
+    public void shouldReturnInputParametersFromBlueprint() throws IOException {
+        //given
+        String expectedBlueprintInputsText = "{\"aaiEnrichmentHost\":\"aai.onap.svc.cluster.local\""
+            + ",\"aaiEnrichmentPort\":\"8443\""
+            + ",\"enableAAIEnrichment\":true"
+            + ",\"dmaap_host\":\"message-router\""
+            + ",\"dmaap_port\":\"3904\""
+            + ",\"enableRedisCaching\":false"
+            + ",\"redisHosts\":\"dcae-redis:6379\""
+            + ",\"tag_version\":\"nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.0\""
+            + ",\"consul_host\":\"consul-server\""
+            + ",\"consul_port\":\"8500\",\"cbs_host\":\"{\\\"test\\\":"
+            + "{\\\"test\\\":\\\"test\\\"}}\",\"cbs_port\":\"10000\""
+            + ",\"external_port\":\"32010\",\"policy_id\":\"AUTO_GENERATED_POLICY_ID_AT_SUBMIT\"}";
+
+        JsonObject expectedBlueprintInputs = JsonUtils.GSON.fromJson(expectedBlueprintInputsText, JsonObject.class);
+        String dceaBlueprint = ResourceFileUtil.getResourceAsString("tosca/dcea_blueprint.yml");
+        BlueprintArtifact blueprintArtifact = mock(BlueprintArtifact.class);
+        when(blueprintArtifact.getDcaeBlueprint()).thenReturn(dceaBlueprint);
+        CsarInstallerImpl csarInstaller = new CsarInstallerImpl();
+
+        //when
+        String parametersInJson = csarInstaller.getAllBlueprintParametersInJson(blueprintArtifact);
+
+        //then
+        assertThat(JsonUtils.GSON.fromJson(parametersInJson, JsonObject.class)).isEqualTo(expectedBlueprintInputs);
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/onap/clamp/clds/util/JacksonUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/JacksonUtilsTest.java
deleted file mode 100644
index 1d9e4e7..0000000
--- a/src/test/java/org/onap/clamp/clds/util/JacksonUtilsTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights
- *                             reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- *
- */
-
-package org.onap.clamp.clds.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-public class JacksonUtilsTest {
-
-    public static class TestClass extends TestObject {
-
-        String test2;
-        TestObject2 object2;
-
-        public TestClass(String value1, String value2) {
-            super(value1);
-            test2 = value2;
-        }
-
-        public TestClass() {
-        }
-
-        public String getTest2() {
-            return test2;
-        }
-
-        public void setTest2(String test2) {
-            this.test2 = test2;
-        }
-
-        public TestObject2 getObject2() {
-            return object2;
-        }
-
-        public void setObject2(TestObject2 object2) {
-            this.object2 = object2;
-        }
-    }
-
-    @Test
-    public void testGetObjectMapperInstance() {
-        assertNotNull(JacksonUtils.getObjectMapperInstance());
-    }
-
-    /**
-     * This method test that the security hole in Jackson is not enabled in the
-     * default ObjectMapper.
-     *
-     * @throws JsonParseException
-     *         In case of issues
-     * @throws JsonMappingException
-     *         In case of issues
-     * @throws IOException
-     *         In case of issues
-     */
-    @Test
-    public void testCreateBeanDeserializer() throws JsonParseException, JsonMappingException, IOException {
-        TestClass test = new TestClass("value1", "value2");
-        test.setObject2(new TestObject2("test3"));
-        Object testObject = JacksonUtils.getObjectMapperInstance()
-            .readValue("[\"org.onap.clamp.clds.util.JacksonUtilsTest$TestClass\""
-                + ",{\"test\":\"value1\",\"test2\":\"value2\",\"object2\":[\"org.onap.clamp.clds.util.TestObject2\","
-                + "{\"test3\":\"test3\"}]}]", Object.class);
-        assertNotNull(testObject);
-        assertFalse(testObject instanceof TestObject);
-        assertFalse(testObject instanceof TestClass);
-    }
-}
diff --git a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
new file mode 100644
index 0000000..3e11b8a
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * Modifications copyright (c) 2019 Nokia
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.util;
+
+import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import java.io.IOException;
+
+import java.util.List;
+import org.junit.Test;
+
+public class JsonUtilsTest {
+
+    public static class TestClass extends TestObject {
+
+        String test2;
+        TestObject2 object2;
+
+        TestClass(String value1, String value2) {
+            super(value1);
+            test2 = value2;
+        }
+
+        void setObject2(TestObject2 object2) {
+            this.object2 = object2;
+        }
+    }
+
+    private static final JsonObject DEPLOY_PARAMETERS = JsonUtils.GSON.fromJson(
+        "{\n"
+            + "        \"aaiEnrichmentHost\": \"aai.onap.svc.cluster.local\",\n"
+            + "        \"aaiEnrichmentPort\": \"8443\",\n"
+            + "        \"enableAAIEnrichment\": true,\n"
+            + "        \"dmaap_host\": \"message-router\",\n"
+            + "        \"dmaap_port\": \"3904\",\n"
+            + "        \"enableRedisCaching\": false,\n"
+            + "        \"redisHosts\": \"dcae-redis:6379\",\n"
+            + "        \"tag_version\": \"nexus3.onap.org:10001/onap/org.onap.dcaegen2."
+            + "deployments.tca-cdap-container:1.1.0\",\n"
+            + "        \"consul_host\": \"consul-server\",\n"
+            + "        \"consul_port\": \"8500\",\n"
+            + "        \"cbs_host\": \"config-binding-service\",\n"
+            + "        \"cbs_port\": \"10000\",\n"
+            + "        \"external_port\": \"32010\",\n"
+            + "        \"policy_id\": \"AUTO_GENERATED_POLICY_ID_AT_SUBMIT\"\n"
+            + "      }", JsonObject.class);
+
+
+    @Test
+    public void testGetObjectMapperInstance() {
+        assertNotNull(JsonUtils.GSON);
+    }
+
+    /**
+     * This method test that the security hole in Jackson is not enabled in the default ObjectMapper.
+     */
+    @Test
+    public void testCreateBeanDeserializer() {
+        TestClass test = new TestClass("value1", "value2");
+        test.setObject2(new TestObject2("test3"));
+        Object testObject = JsonUtils.GSON.fromJson("[\"org.onap.clamp.clds.util.JsonUtilsTest$TestClass\""
+            + ",{\"test\":\"value1\",\"test2\":\"value2\",\"object2\":[\"org.onap.clamp.clds.util.TestObject2\","
+            + "{\"test3\":\"test3\"}]}]", Object.class);
+        assertNotNull(testObject);
+        assertFalse(testObject instanceof TestObject);
+    }
+
+
+    @Test
+    public void shouldReturnJsonValueByName() throws IOException {
+        //given
+        String modelProperties = ResourceFileUtil
+            .getResourceAsString("example/model-properties/custom/modelBpmnPropertiesMultiVF.json");
+        JsonElement globalElement = JsonUtils.GSON.fromJson(modelProperties, JsonObject.class).get("global");
+
+        //when
+        String locationName = JsonUtils.getStringValueByName(globalElement, "location");
+        String timeoutValue = JsonUtils.getStringValueByName(globalElement, "timeout");
+
+        //then
+        assertThat(locationName).isEqualTo("SNDGCA64");
+        assertThat(timeoutValue).isEqualTo("500");
+    }
+
+    @Test
+    public void shouldReturnJsonObjectByPropertyName() throws IOException {
+        //given
+        String modelProperties = ResourceFileUtil
+            .getResourceAsString("example/model-properties/custom/modelBpmnPropertiesMultiVF.json");
+        JsonElement globalElement = JsonUtils.GSON.fromJson(modelProperties, JsonObject.class).get("global");
+
+        //when
+        JsonObject deployParameters = JsonUtils.getJsonObjectByName(globalElement, "deployParameters");
+
+        //then
+        assertThat(deployParameters).isEqualToComparingFieldByField(DEPLOY_PARAMETERS);
+    }
+
+    @Test
+    public void shouldReturnJsonValuesByPropertyName() throws IOException {
+        //given
+        String modelProperties = ResourceFileUtil
+            .getResourceAsString("example/model-properties/custom/modelBpmnPropertiesMultiVF.json");
+        JsonElement globalElement = JsonUtils.GSON.fromJson(modelProperties, JsonObject.class).get("global");
+
+        //when
+        List<String> vfs = JsonUtils.getStringValuesByName(globalElement, "vf");
+
+        //then
+        assertThat(vfs).containsExactly(
+            "6c7aaec2-59eb-41d9-8681-b7f976ab668d",
+            "8sadsad0-a98s-6a7s-fd12-sadji9sa8d12",
+            "8sfd71ad-a90d-asd9-as87-8a7sd81adsaa"
+        );
+    }
+
+
+    @Test
+    public void shouldReturnJsonValueAsInteger() throws IOException {
+        //given
+        String modelProperties = ResourceFileUtil
+            .getResourceAsString("example/model-properties/custom/modelBpmnPropertiesMultiVF.json");
+        JsonElement globalElement = JsonUtils.GSON.fromJson(modelProperties, JsonObject.class).get("global");
+
+        //when
+        Integer timeoutValue = JsonUtils.getIntValueByName(globalElement, "timeout");
+
+        //then
+        assertThat(timeoutValue).isEqualTo(500);
+    }
+}
diff --git a/src/test/resources/example/model-properties/custom/modelBpmnPropertiesMultiVF.json b/src/test/resources/example/model-properties/custom/modelBpmnPropertiesMultiVF.json
new file mode 100644
index 0000000..211aaec
--- /dev/null
+++ b/src/test/resources/example/model-properties/custom/modelBpmnPropertiesMultiVF.json
@@ -0,0 +1,273 @@
+{
+    "global":
+    [
+        {
+            "name": "service",
+            "value":
+            [
+                "0f983e18-4603-4bb4-a98c-e29691fb16a1"
+            ]
+        },
+
+        {
+            "name": "vf",
+            "value":
+            [
+                "6c7aaec2-59eb-41d9-8681-b7f976ab668d",
+                "8sadsad0-a98s-6a7s-fd12-sadji9sa8d12",
+                "8sfd71ad-a90d-asd9-as87-8a7sd81adsaa"
+            ]
+        },
+
+        {
+            "name": "actionSet",
+            "value":
+            [
+                "vnfRecipe"
+            ]
+        },
+
+        {
+            "name": "location",
+            "value":
+            [
+                "SNDGCA64"
+            ]
+        },
+        {
+            "name": "timeout",
+            "value": "500"
+        },
+        {
+            "name": "deployParameters",
+            "value": {
+                "aaiEnrichmentHost": "aai.onap.svc.cluster.local",
+                "aaiEnrichmentPort": "8443",
+                "enableAAIEnrichment": true,
+                "dmaap_host": "message-router",
+                "dmaap_port": "3904",
+                "enableRedisCaching": false,
+                "redisHosts": "dcae-redis:6379",
+                "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.0",
+                "consul_host": "consul-server",
+                "consul_port": "8500",
+                "cbs_host": "config-binding-service",
+                "cbs_port": "10000",
+                "external_port": "32010",
+                "policy_id": "AUTO_GENERATED_POLICY_ID_AT_SUBMIT"
+            }
+        }
+    ],
+
+    "Policy_":
+    {
+        "Policy1":
+        [
+            {
+                "name": "pname",
+                "value": "Policy1"
+            },
+
+            {
+                "name": "pid",
+                "value": "1"
+            },
+
+            {
+                "name": "timeout",
+                "value": "500"
+            },
+
+            {
+                "policyConfigurations":
+                [
+                    [
+                        {
+                            "name": "recipe",
+                            "value":
+                            [
+                                "restart"
+                            ]
+                        },
+
+                        {
+                            "name": "maxRetries",
+                            "value":
+                            [
+                                "3"
+                            ]
+                        },
+
+                        {
+                            "name": "retryTimeLimit",
+                            "value":
+                            [
+                                "180"
+                            ]
+                        },
+
+                        {
+                            "name": "_id",
+                            "value":
+                            [
+                                "n9bQ4t6"
+                            ]
+                        },
+
+                        {
+                            "name": "parentPolicy",
+                            "value":
+                            [
+                                ""
+                            ]
+                        },
+                        {
+                            "name": "targetResourceId",
+                            "value":
+                            [
+                                "resource-id"
+                            ]
+                        }
+                    ],
+
+                    [
+                        {
+                            "name": "recipe",
+                            "value":
+                            [
+                                "rebuild"
+                            ]
+                        },
+
+                        {
+                            "name": "maxRetries",
+                            "value":
+                            [
+                                "3"
+                            ]
+                        },
+
+                        {
+                            "name": "retryTimeLimit",
+                            "value":
+                            [
+                                "180"
+                            ]
+                        },
+
+                        {
+                            "name": "_id",
+                            "value":
+                            [
+                                "ItE5xKT"
+                            ]
+                        },
+
+                        {
+                            "name": "parentPolicy",
+                            "value":
+                            [
+                                "n9bQ4t6"
+                            ]
+                        },
+
+                        {
+                            "name": "parentPolicyConditions",
+                            "value":
+                            [
+                                "Failure_Retries",
+                                "Failure_Timeout",
+                                "Failure_Exception",
+                                "Failure"
+                            ]
+                        },
+                        {
+                            "name": "targetResourceId",
+                            "value":
+                            [
+                                "resource-id"
+                            ]
+                        }
+                    ]
+                ]
+            }
+        ]
+    },
+
+    "TCA_":
+    {
+        "Narra":
+        [
+            {
+                "name": "tname",
+                "value": "Narra"
+            },
+
+            {
+                "name": "tuuid",
+                "value": "886be8da-14fe-tca1-d04b-d13b55d58df9"
+            },
+
+            {
+                "name": "tnfc",
+                "value": "ENBE"
+            },
+
+            {
+                "name": "tcaEnab",
+                "value": "on"
+            },
+
+            {
+                "name": "tcaPol",
+                "value": "Policy1"
+            },
+
+            {
+                "name": "tcaPolId",
+                "value": "1"
+            },
+
+            {
+                "name": "tcaInt",
+                "value": "2"
+            },
+
+            {
+                "name": "tcaSev",
+                "value": "Warning"
+            },
+
+            {
+                "name": "tcaVio",
+                "value": "3"
+            },
+
+            {
+                "serviceConfigurations":
+                [
+                    [
+                        "PMRRCCONNESTABFAILCELLLATENCY",
+                        "LESS",
+                        "4",
+                        "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
+                    ],
+
+                    [
+                        "PMRAATTCBRA",
+                        "GREATER",
+                        "30",
+                        "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
+                    ]
+                ]
+            }
+        ]
+    },
+    
+    "CustomType_": [
+      {
+         "name": "test",
+         "value": "This is a test"
+      }
+    ]
+}
\ No newline at end of file
diff --git a/src/test/resources/tosca/dcea_blueprint.yml b/src/test/resources/tosca/dcea_blueprint.yml
new file mode 100644
index 0000000..0d3ea04
--- /dev/null
+++ b/src/test/resources/tosca/dcea_blueprint.yml
@@ -0,0 +1,170 @@
+#
+# ============LICENSE_START====================================================
+# =============================================================================
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END======================================================
+
+tosca_definitions_version: cloudify_dsl_1_3
+
+description: >
+  This blueprint deploys/manages the TCA module as a Docker container
+
+imports:
+  - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
+  - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.4/k8splugin_types.yaml
+  - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml
+inputs:
+  aaiEnrichmentHost:
+    type: string
+    default: "aai.onap.svc.cluster.local"
+  aaiEnrichmentPort:
+    type: string
+    default: "8443"
+  enableAAIEnrichment:
+    type: string
+    default: true
+  dmaap_host:
+    type: string
+    default: message-router
+  dmaap_port:
+    type: string
+    default: "3904"
+  enableRedisCaching:
+    type: string
+    default: false
+  redisHosts:
+    type: string
+    default: dcae-redis:6379
+  tag_version:
+    type: string
+    default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.0"
+  consul_host:
+    type: string
+    default: consul-server
+  consul_port:
+    type: string
+    default: "8500"
+  cbs_host:
+    type: string
+    default:
+      test:
+        test: test
+  cbs_port:
+    type: string
+    default: "10000"
+  policy_id:
+    type: string
+    default: "none"
+  external_port:
+    type: string
+    description: Kubernetes node port on which CDAPgui is exposed
+    default: "32010"
+
+node_templates:
+  tca_k8s:
+    type: dcae.nodes.ContainerizedServiceComponent
+    relationships:
+      - target: tca_policy
+        type: cloudify.relationships.depends_on
+    properties:
+      service_component_type: 'dcaegen2-analytics-tca'
+      docker_config: {}
+      image:
+        get_input: tag_version
+      log_info:
+        log_directory: "/opt/app/TCAnalytics/logs"
+      application_config:
+        app_config:
+          appDescription: DCAE Analytics Threshold Crossing Alert Application
+          appName: dcae-tca-ak-serv
+          tcaAlertsAbatementTableName: TCAAlertsAbatementTable
+          tcaAlertsAbatementTableTTLSeconds: '1728000'
+          tcaSubscriberOutputStreamName: TCASubscriberOutputStream
+          tcaVESAlertsTableName: TCAVESAlertsTable
+          tcaVESAlertsTableTTLSeconds: '1728000'
+          tcaVESMessageStatusTableName: TCAVESMessageStatusTable
+          tcaVESMessageStatusTableTTLSeconds: '86400'
+          thresholdCalculatorFlowletInstances: '2'
+        app_preferences:
+          aaiEnrichmentHost:
+            get_input: aaiEnrichmentHost
+          aaiEnrichmentIgnoreSSLCertificateErrors: 'true'
+          aaiEnrichmentPortNumber: '8443'
+          aaiEnrichmentProtocol: https
+          aaiEnrichmentUserName: DCAE
+          aaiEnrichmentUserPassword: DCAE
+          aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query
+          aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf
+          enableAAIEnrichment:
+            get_input: enableAAIEnrichment
+          enableRedisCaching:
+            get_input: enableRedisCaching
+          redisHosts:
+            get_input: redisHosts
+          enableAlertCEFFormat: 'false'
+          publisherContentType: application/json
+          publisherHostName:
+            get_input: dmaap_host
+          publisherHostPort:
+            get_input: dmaap_port
+          publisherMaxBatchSize: '1'
+          publisherMaxRecoveryQueueSize: '100000'
+          publisherPollingInterval: '20000'
+          publisherProtocol: http
+          publisherTopicName: unauthenticated.DCAE_CL_OUTPUT
+          subscriberConsumerGroup: OpenDCAE-c12
+          subscriberConsumerId: c12
+          subscriberContentType: application/json
+          subscriberHostName:
+            get_input: dmaap_host
+          subscriberHostPort:
+            get_input: dmaap_port
+          subscriberMessageLimit: '-1'
+          subscriberPollingInterval: '30000'
+          subscriberProtocol: http
+          subscriberTimeoutMS: '-1'
+          subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT
+          tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}'
+    interfaces:
+      cloudify.interfaces.lifecycle:
+        start:
+          inputs:
+            envs:
+              DMAAPHOST:
+                { get_input: dmaap_host }
+              DMAAPPORT:
+                { get_input: dmaap_port }
+              DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT"
+              DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT"
+              AAIHOST:
+                { get_input: aaiEnrichmentHost }
+              AAIPORT:
+                { get_input: aaiEnrichmentPort }
+              CONSUL_HOST:
+                { get_input: consul_host }
+              CONSUL_PORT:
+                { get_input: consul_port }
+              CBS_HOST:
+                { get_input: cbs_host }
+              CBS_PORT:
+                { get_input: cbs_port }
+              CONFIG_BINDING_SERVICE: "config_binding_service"
+            ports:
+              - concat: ["11011:", { get_input: external_port }]
+  tca_policy:
+    type: dcae.nodes.policy
+    properties:
+      policy_id:
+        get_input: policy_id
