diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
index 431e9db..ea24a0c 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
@@ -11,9 +11,9 @@
  * 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.
@@ -27,6 +27,8 @@
 import java.io.StringReader;
 import java.net.HttpURLConnection;
 import java.net.SocketTimeoutException;
+import java.util.Arrays;
+import java.util.List;
 import javax.xml.XMLConstants;
 import javax.xml.bind.DatatypeConverter;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -71,7 +73,6 @@
 public abstract class SDNCConnector {
     private static final Logger logger = LoggerFactory.getLogger(SDNCConnector.class);
 
-    private static final String MSO_INTERNAL_ERROR = "MsoInternalError";
     private static final String XPATH_EXCEPTION = "XPath Exception";
     @Autowired
     private Environment env;
@@ -84,32 +85,10 @@
         HttpResponse httpResponse = null;
 
         try {
-            int timeout = Integer.parseInt(rt.getTimeout());
-
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
-                    .setConnectionRequestTimeout(timeout).build();
 
             HttpClient client = HttpClientBuilder.create().build();
 
-            if ("POST".equals(rt.getReqMethod())) {
-                HttpPost httpPost = new HttpPost(rt.getSdncUrl());
-                httpPost.setConfig(requestConfig);
-                httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_XML));
-                method = httpPost;
-            } else if ("PUT".equals(rt.getReqMethod())) {
-                HttpPut httpPut = new HttpPut(rt.getSdncUrl());
-                httpPut.setConfig(requestConfig);
-                httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_XML));
-                method = httpPut;
-            } else if ("GET".equals(rt.getReqMethod())) {
-                HttpGet httpGet = new HttpGet(rt.getSdncUrl());
-                httpGet.setConfig(requestConfig);
-                method = httpGet;
-            } else if ("DELETE".equals(rt.getReqMethod())) {
-                HttpDelete httpDelete = new HttpDelete(rt.getSdncUrl());
-                httpDelete.setConfig(requestConfig);
-                method = httpDelete;
-            }
+            method = getHttpRequestMethod(content, rt);
 
 
             String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP),
@@ -122,8 +101,6 @@
                 logger.debug("method is NULL:");
             }
 
-
-
             httpResponse = client.execute(method);
 
             String responseContent = null;
@@ -141,7 +118,7 @@
                 String errMsg = "SDNC returned " + statusCode + " " + statusMessage;
 
                 String errors = analyzeErrors(responseContent);
-                if (errors != null) {
+                if (errors != null && !errors.isEmpty()) {
                     errMsg += " " + errors;
                 }
 
@@ -192,6 +169,36 @@
         }
     }
 
+    private HttpRequestBase getHttpRequestMethod(String content, TypedRequestTunables rt) {
+
+        int timeout = Integer.parseInt(rt.getTimeout());
+        HttpRequestBase method = null;
+
+        RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
+                .setConnectionRequestTimeout(timeout).build();
+
+        if ("POST".equals(rt.getReqMethod())) {
+            HttpPost httpPost = new HttpPost(rt.getSdncUrl());
+            httpPost.setConfig(requestConfig);
+            httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_XML));
+            method = httpPost;
+        } else if ("PUT".equals(rt.getReqMethod())) {
+            HttpPut httpPut = new HttpPut(rt.getSdncUrl());
+            httpPut.setConfig(requestConfig);
+            httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_XML));
+            method = httpPut;
+        } else if ("GET".equals(rt.getReqMethod())) {
+            HttpGet httpGet = new HttpGet(rt.getSdncUrl());
+            httpGet.setConfig(requestConfig);
+            method = httpGet;
+        } else if ("DELETE".equals(rt.getReqMethod())) {
+            HttpDelete httpDelete = new HttpDelete(rt.getSdncUrl());
+            httpDelete.setConfig(requestConfig);
+            method = httpDelete;
+        }
+        return method;
+    }
+
     protected void logError(String errMsg) {
         logger.error(LoggingAnchor.FOUR, MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
                 ErrorCode.AvailabilityError.getValue(), errMsg);
@@ -205,7 +212,7 @@
     /**
      * Generates a response object from content received from SDNC. The response object may be a success response object
      * or an error response object. This method must be overridden by the subclass to return the correct object type.
-     * 
+     *
      * @param statusCode the response status code from SDNC (e.g. 200)
      * @param statusMessage the response status message from SDNC (e.g. "OK")
      * @param responseContent the body of the response from SDNC (possibly null)
@@ -218,7 +225,7 @@
     /**
      * Generates an error response object. This method must be overridden by the subclass to return the correct object
      * type.
-     * 
+     *
      * @param statusCode the response status code (from SDNC, or internally generated)
      * @param errMsg the error message (normally a verbose explanation of the error)
      * @param rt request tunables
@@ -229,17 +236,17 @@
     /**
      * Called by the send() method to analyze errors that may be encoded in the content of non-2XX responses. By
      * default, this method tries to parse the content as a restconf error.
-     * 
+     *
      * <pre>
      * xmlns = "urn:ietf:params:xml:ns:yang:ietf-restconf"
      * </pre>
-     * 
+     *
      * If an error (or errors) can be obtained from the content, then the result is a string in this format:
-     * 
+     *
      * <pre>
      * [error-type:TYPE, error-tag:TAG, error-message:MESSAGE] ...
      * </pre>
-     * 
+     *
      * If no error could be obtained from the content, then the result is null.
      * <p>
      * The subclass can override this method to provide another implementation.
@@ -262,7 +269,7 @@
         // </error>
         // </errors>
 
-        StringBuilder output = null;
+        String output = null;
 
         try {
             XPathFactory xpathFactory = XPathFactory.newInstance();
@@ -274,55 +281,47 @@
             InputSource source = new InputSource(new StringReader(content));
             Document doc = documentBuilderFactory.newDocumentBuilder().parse(source);
             NodeList errors = (NodeList) xpath.evaluate("errors/error", doc, XPathConstants.NODESET);
-
-            for (int i = 0; i < errors.getLength(); i++) {
-                Element error = (Element) errors.item(i);
-
-                String info = "";
-
-                try {
-                    String errorType = xpath.evaluate("error-type", error);
-                    info += "error-type:" + errorType;
-                } catch (XPathExpressionException e) {
-                    logger.error(LoggingAnchor.SIX, MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-type",
-                            error.toString(), "SDNC", ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
-                }
-
-                try {
-                    String errorTag = xpath.evaluate("error-tag", error);
-                    if (!info.isEmpty()) {
-                        info += ", ";
-                    }
-                    info += "error-tag:" + errorTag;
-                } catch (XPathExpressionException e) {
-                    logger.error(LoggingAnchor.SIX, MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-tag",
-                            error.toString(), "SDNC", ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
-                }
-
-                try {
-                    String errorMessage = xpath.evaluate("error-message", error);
-                    if (!info.isEmpty()) {
-                        info += ", ";
-                    }
-                    info += "error-message:" + errorMessage;
-                } catch (Exception e) {
-                    logger.error(LoggingAnchor.SIX, MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-message",
-                            error.toString(), "SDNC", ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
-                }
-
-                if (!info.isEmpty()) {
-                    if (output == null) {
-                        output = new StringBuilder("[" + info + "]");
-                    } else {
-                        output.append(" [").append(info).append("]");
-                    }
-                }
+            StringBuilder errorDetails = getErrorDetails(xpath, errors);
+            if (errorDetails != null) {
+                output = errorDetails.toString();
             }
         } catch (Exception e) {
             logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ANALYZE_ERROR_EXC.toString(), "SDNC",
                     ErrorCode.DataError.getValue(), "Exception while analyzing errors", e);
         }
 
-        return output.toString();
+        return output;
+    }
+
+    private StringBuilder getErrorDetails(XPath xpath, NodeList errors) {
+
+        StringBuilder output = null;
+
+        for (int i = 0; i < errors.getLength(); i++) {
+            Element error = (Element) errors.item(i);
+
+            StringBuilder info = new StringBuilder();
+
+            List<String> errorAttributesList = Arrays.asList("error-type", "error-tag", "error-message");
+
+            for (String errorAttrib : errorAttributesList) {
+                try {
+                    String errorAttribValue = xpath.evaluate(errorAttrib, error);
+                    info.append(errorAttrib).append(":").append(errorAttribValue);
+                } catch (XPathExpressionException e) {
+                    logger.error(LoggingAnchor.SIX, MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), errorAttrib,
+                            error.toString(), "SDNC", ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
+                }
+            }
+
+            if (!info.toString().isEmpty()) {
+                if (output == null) {
+                    output = new StringBuilder("[" + info + "]");
+                } else {
+                    output.append(" [").append(info).append("]");
+                }
+            }
+        }
+        return output;
     }
 }
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
index 6f76ea1..9dd95c6 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
@@ -11,9 +11,9 @@
  * 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.
@@ -59,9 +59,6 @@
             TypedRequestTunables rt) {
         try {
             return parseResponseContent(responseContent);
-        } catch (ParseException e) {
-            logger.error("Error occured:", e);
-            return createErrorResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, e.getMessage(), rt);
         } catch (Exception e) {
             logger.error("Error occured:", e);
             return createErrorResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, e.getMessage(), rt);
@@ -79,10 +76,10 @@
      * response code contained in the content. For 2XX response codes, an SDNCServiceResponse is returned. Otherwise, an
      * SDNCServiceError is returned. If the content cannot be parsed, or if the content does not contain all required
      * elements, a parse exception is thrown. This method performs no logging or alarming.
-     * 
+     *
      * @throws ParseException on error
      */
-    public static SDNCResponseCommon parseResponseContent(String responseContent)
+    public SDNCResponseCommon parseResponseContent(String responseContent)
             throws ParseException, ParserConfigurationException, SAXException, IOException {
 
         // Note: this document builder is not namespace-aware, so namespaces are ignored.
@@ -119,16 +116,24 @@
         List<Element> responseParameters = new ArrayList<>();
 
         for (Element child : SDNCAdapterUtils.childElements(configurationResponseCommon)) {
-            if ("response-code".equals(child.getNodeName())) {
-                responseCode = child.getTextContent();
-            } else if ("response-message".equals(child.getNodeName())) {
-                responseMessage = child.getTextContent();
-            } else if ("svc-request-id".equals(child.getNodeName())) {
-                svcRequestId = child.getTextContent();
-            } else if ("ack-final-indicator".equals(child.getNodeName())) {
-                ackFinalIndicator = child.getTextContent();
-            } else if ("response-parameters".equals(child.getNodeName())) {
-                responseParameters.add(child);
+
+            switch (child.getNodeName()) {
+                case "response-code":
+                    responseCode = child.getTextContent();
+                    break;
+                case "response-message":
+                    responseMessage = child.getTextContent();
+                    break;
+                case "svc-request-id":
+                    svcRequestId = child.getTextContent();
+                    break;
+                case "ack-final-indicator":
+                    ackFinalIndicator = child.getTextContent();
+                    break;
+                case "response-parameters":
+                    responseParameters.add(child);
+                    break;
+                default:
             }
         }
 
@@ -167,8 +172,15 @@
             return new SDNCServiceError(svcRequestId, responseCode, responseMessage, ackFinalIndicator);
         }
 
-        // Create a success response object.
+        return createSDNCServiceResponse(responseCode, responseMessage, svcRequestId, ackFinalIndicator,
+                responseParameters);
 
+    }
+
+    private SDNCServiceResponse createSDNCServiceResponse(String responseCode, String responseMessage,
+            String svcRequestId, String ackFinalIndicator, List<Element> responseParameters) throws ParseException {
+
+        // Create a success response object.
         SDNCServiceResponse response =
                 new SDNCServiceResponse(svcRequestId, responseCode, responseMessage, ackFinalIndicator);
 
@@ -201,8 +213,6 @@
 
             response.addParam(tagName, tagValue);
         }
-
         return response;
-
     }
 }
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java
index 9911cae..9adc6c5 100644
--- a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java
@@ -7,9 +7,9 @@
  * 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.
@@ -31,7 +31,8 @@
     public void parseResponseContentTest() throws Exception {
 
         String content = FileUtil.readResourceFile("SdncServiceResponse.xml");
-        SDNCResponseCommon responseCommon = SDNCServiceRequestConnector.parseResponseContent(content);
+        SDNCServiceRequestConnector sdncServiceRequestConnector = new SDNCServiceRequestConnector();
+        SDNCResponseCommon responseCommon = sdncServiceRequestConnector.parseResponseContent(content);
 
         assertNotNull(responseCommon);
     }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java
index 6840dd3..860dfbb 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java
@@ -20,16 +20,41 @@
 
 package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
 
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import java.io.IOException;
+import java.security.KeyManagementException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.concurrent.TimeUnit;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
 import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration;
 import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
-import org.onap.so.configuration.rest.HttpHeadersProvider;
+import org.onap.so.configuration.rest.HttpClientConnectionConfiguration;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
 import org.onap.so.rest.service.HttpRestServiceProvider;
 import org.onap.so.rest.service.HttpRestServiceProviderImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.Resource;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -41,16 +66,105 @@
 @Configuration
 public class EtsiCatalogServiceProviderConfiguration extends AbstractServiceProviderConfiguration {
 
-    @Bean(name = "etsiCatalogServiceProvider")
-    public HttpRestServiceProvider httpRestServiceProvider(
-            @Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate) {
-        return getHttpRestServiceProvider(restTemplate, new BasicHttpHeadersProvider());
+    public static final String ETSI_CATALOG_REST_TEMPLATE_BEAN = "etsiCatalogRestTemplate";
+
+    public static final String ETSI_CATALOG_SERVICE_PROVIDER_BEAN = "etsiCatalogServiceProvider";
+
+    private final static Logger LOGGER = LoggerFactory.getLogger(EtsiCatalogServiceProviderConfiguration.class);
+
+    private final HttpClientConnectionConfiguration clientConnectionConfiguration;
+
+    @Value("${etsi-catalog-manager.http.client.ssl.trust-store:#{null}}")
+    private Resource trustStore;
+    @Value("${etsi-catalog-manager.http.client.ssl.trust-store-password:#{null}}")
+    private String trustStorePassword;
+
+    @Autowired
+    public EtsiCatalogServiceProviderConfiguration(
+            final HttpClientConnectionConfiguration clientConnectionConfiguration) {
+        this.clientConnectionConfiguration = clientConnectionConfiguration;
     }
 
-    private HttpRestServiceProvider getHttpRestServiceProvider(final RestTemplate restTemplate,
-            final HttpHeadersProvider httpHeadersProvider) {
+    @Bean
+    @Qualifier(ETSI_CATALOG_REST_TEMPLATE_BEAN)
+    public RestTemplate etsiCatalogRestTemplate() {
+        final RestTemplate restTemplate = new RestTemplate();
+        restTemplate.getInterceptors().add(new SOSpringClientFilter());
+        restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
+        return restTemplate;
+    }
+
+    @Bean
+    @Qualifier(ETSI_CATALOG_SERVICE_PROVIDER_BEAN)
+    public HttpRestServiceProvider etsiCatalogHttpRestServiceProvider(
+            @Qualifier(ETSI_CATALOG_REST_TEMPLATE_BEAN) final RestTemplate restTemplate) {
         setGsonMessageConverter(restTemplate);
-        return new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
+
+        final HttpClientBuilder httpClientBuilder = getHttpClientBuilder();
+        if (trustStore != null) {
+            try {
+                LOGGER.debug("Setting up HttpComponentsClientHttpRequestFactory with SSL Context");
+                LOGGER.debug("Setting client trust-store: {}", trustStore.getURL());
+                LOGGER.debug("Creating SSLConnectionSocketFactory with AllowAllHostsVerifier ... ");
+                final SSLContext sslContext = new SSLContextBuilder()
+                        .loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()).build();
+                final SSLConnectionSocketFactory sslConnectionSocketFactory =
+                        new SSLConnectionSocketFactory(sslContext, AllowAllHostsVerifier.INSTANCE);
+                httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory);
+                final Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder
+                        .<ConnectionSocketFactory>create().register("http", PlainConnectionSocketFactory.INSTANCE)
+                        .register("https", sslConnectionSocketFactory).build();
+
+                httpClientBuilder.setConnectionManager(getConnectionManager(socketFactoryRegistry));
+            } catch (final KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException
+                    | IOException exception) {
+                LOGGER.error("Error reading truststore, TLS connection will fail.", exception);
+            }
+
+        } else {
+            LOGGER.debug("Setting connection manager without SSL ConnectionSocketFactory ...");
+            httpClientBuilder.setConnectionManager(getConnectionManager());
+        }
+
+        final HttpComponentsClientHttpRequestFactory factory =
+                new HttpComponentsClientHttpRequestFactory(httpClientBuilder.build());
+        restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory));
+
+        return new HttpRestServiceProviderImpl(restTemplate, new BasicHttpHeadersProvider().getHttpHeaders());
+    }
+
+    private PoolingHttpClientConnectionManager getConnectionManager(
+            final Registry<ConnectionSocketFactory> socketFactoryRegistry) {
+        return new PoolingHttpClientConnectionManager(socketFactoryRegistry, null, null, null,
+                clientConnectionConfiguration.getTimeToLiveInMins(), TimeUnit.MINUTES);
+    }
+
+    private PoolingHttpClientConnectionManager getConnectionManager() {
+        return new PoolingHttpClientConnectionManager(clientConnectionConfiguration.getTimeToLiveInMins(),
+                TimeUnit.MINUTES);
+    }
+
+    private HttpClientBuilder getHttpClientBuilder() {
+        return HttpClientBuilder.create().setMaxConnPerRoute(clientConnectionConfiguration.getMaxConnectionsPerRoute())
+                .setMaxConnTotal(clientConnectionConfiguration.getMaxConnections())
+                .setDefaultRequestConfig(getRequestConfig());
+    }
+
+    private RequestConfig getRequestConfig() {
+        return RequestConfig.custom().setSocketTimeout(clientConnectionConfiguration.getSocketTimeOutInMiliSeconds())
+                .setConnectTimeout(clientConnectionConfiguration.getConnectionTimeOutInMilliSeconds()).build();
+    }
+
+    private static final class AllowAllHostsVerifier implements HostnameVerifier {
+
+        private static final AllowAllHostsVerifier INSTANCE = new AllowAllHostsVerifier();
+
+        @Override
+        public boolean verify(final String hostname, final SSLSession session) {
+            LOGGER.debug("Skipping hostname verification ...");
+            return true;
+        }
+
     }
 
 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java
index 30d0846..cae413c 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java
@@ -20,6 +20,7 @@
 
 package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
 
+import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_SERVICE_PROVIDER_BEAN;
 import java.util.Optional;
 import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription;
 import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription;
@@ -53,14 +54,14 @@
 public class EtsiCatalogServiceProviderImpl implements EtsiCatalogServiceProvider {
     private static final Logger logger = LoggerFactory.getLogger(EtsiCatalogServiceProviderImpl.class);
 
-    @Qualifier("etsiCatalogServiceProvider")
     private final HttpRestServiceProvider httpServiceProvider;
     private final EtsiCatalogUrlProvider etsiCatalogUrlProvider;
     private final ConversionService conversionService;
 
     @Autowired
     public EtsiCatalogServiceProviderImpl(final EtsiCatalogUrlProvider etsiCatalogUrlProvider,
-            final HttpRestServiceProvider httpServiceProvider, final ConversionService conversionService) {
+            @Qualifier(ETSI_CATALOG_SERVICE_PROVIDER_BEAN) final HttpRestServiceProvider httpServiceProvider,
+            final ConversionService conversionService) {
         this.etsiCatalogUrlProvider = etsiCatalogUrlProvider;
         this.httpServiceProvider = httpServiceProvider;
         this.conversionService = conversionService;
@@ -118,8 +119,10 @@
                             if (inlineResponse2001 != null) {
                                 responses[index] = inlineResponse2001;
                             }
+                        } else {
+                            logger.error("Unable to find Converter for response class: {}",
+                                    vnfPackages[index].getClass());
                         }
-                        logger.error("Unable to find Converter for response class: {}", vnfPackages[index].getClass());
                     }
                     return Optional.of(responses);
                 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java
new file mode 100644
index 0000000..9ed17e4
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2020 Ericsson. 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.
+ * 
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
+
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration;
+import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProviderImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+@Configuration
+public class VnfmHttpServiceProviderConfiguration extends AbstractServiceProviderConfiguration {
+    public static final String VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN = "vnfmAdapterHttpServiceProvider";
+
+    @Bean
+    @Qualifier(VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN)
+    public HttpRestServiceProvider vnfmAdapterHttpRestServiceProvider(
+            @Autowired @Qualifier(CONFIGURABLE_REST_TEMPLATE) RestTemplate restTemplate) {
+        setGsonMessageConverter(restTemplate);
+        return new HttpRestServiceProviderImpl(restTemplate, new BasicHttpHeadersProvider().getHttpHeaders());
+    }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java
index 86ca59c..d6b7ae7 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java
@@ -19,16 +19,13 @@
  */
 package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement;
 
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHttpServiceProviderConfiguration.VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN;
 import java.nio.charset.StandardCharsets;
 import org.apache.commons.codec.binary.Base64;
 import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
-import org.onap.so.configuration.rest.HttpHeadersProvider;
 import org.onap.so.rest.service.HttpRestServiceProvider;
-import org.onap.so.rest.service.HttpRestServiceProviderImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.web.client.RestTemplate;
 
 /**
  * A base class that can be extended by classes for providing notification services. Provides common methods that will
@@ -40,12 +37,10 @@
 public abstract class AbstractNotificationServiceProvider {
 
     @Autowired
-    @Qualifier(CONFIGURABLE_REST_TEMPLATE)
-    private RestTemplate restTemplate;
+    @Qualifier(VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN)
+    private HttpRestServiceProvider httpRestServiceProvider;
 
-    protected HttpRestServiceProvider getHttpRestServiceProvider(final HttpHeadersProvider httpHeadersProvider) {
-        final HttpRestServiceProvider httpRestServiceProvider =
-                new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
+    protected HttpRestServiceProvider getHttpRestServiceProvider() {
         return httpRestServiceProvider;
     }
 
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java
index 6f9d94e..cf0cdb0 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java
@@ -47,10 +47,10 @@
         final HttpHeadersProvider httpHeadersProvider =
                 getBasicHttpHeadersProviderWithBasicAuth(subscriptionsAuthentication.getParamsBasic().getUserName(),
                         subscriptionsAuthentication.getParamsBasic().getPassword());
-        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider(httpHeadersProvider);
+        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider();
 
-        final ResponseEntity<Void> responseEntity =
-                httpRestServiceProvider.postHttpRequest(notification, callbackUri, Void.class);
+        final ResponseEntity<Void> responseEntity = httpRestServiceProvider.postHttpRequest(notification, callbackUri,
+                httpHeadersProvider.getHttpHeaders(), Void.class);
         if (responseEntity.getStatusCode().is2xxSuccessful()) {
             logger.info("Notification sent successfully.");
             return true;
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java
index 496fb08..c065203 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java
@@ -48,13 +48,14 @@
         final String token = getAccessToken(subscriptionsAuthentication);
 
         if (token == null) {
+            logger.error("Failed to get access token");
             return false;
         }
 
         final HttpHeadersProvider httpHeadersProvider = getHttpHeadersProvider(token);
-        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider(httpHeadersProvider);
-        final ResponseEntity<Void> responseEntity =
-                httpRestServiceProvider.postHttpRequest(notification, callbackUri, Void.class);
+        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider();
+        final ResponseEntity<Void> responseEntity = httpRestServiceProvider.postHttpRequest(notification, callbackUri,
+                httpHeadersProvider.getHttpHeaders(), Void.class);
         if (responseEntity.getStatusCode().is2xxSuccessful()) {
             logger.info("Notification sent successfully.");
             return true;
@@ -83,9 +84,9 @@
                 subscriptionsAuthentication.getParamsOauth2ClientCredentials().getClientId(),
                 subscriptionsAuthentication.getParamsOauth2ClientCredentials().getClientPassword());
 
-        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider(httpHeadersProvider);
-        final ResponseEntity<OAuthTokenResponse> responseEntity =
-                httpRestServiceProvider.postHttpRequest(null, tokenEndpoint, OAuthTokenResponse.class);
+        final HttpRestServiceProvider httpRestServiceProvider = getHttpRestServiceProvider();
+        final ResponseEntity<OAuthTokenResponse> responseEntity = httpRestServiceProvider.postHttpRequest(null,
+                tokenEndpoint, httpHeadersProvider.getHttpHeaders(), OAuthTokenResponse.class);
         if (responseEntity.getStatusCode().is2xxSuccessful()) {
             if (responseEntity.getBody() != null) {
                 logger.info("Returning Access Token.");
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java
index 322251e..29afa8c 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java
@@ -278,7 +278,7 @@
         mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST))
                 .andExpect(jsonPath("$.id").value(NOTIFICATION_ID))
                 .andExpect(jsonPath("$.notificationType").value(
-                        VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.toString()))
+                        VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.getValue()))
                 .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID))
                 .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString()))
                 .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString()))
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
index c5194cf..31e612a 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
@@ -25,7 +25,7 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL;
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
@@ -74,11 +74,11 @@
     private int port;
 
     @Autowired
-    @Qualifier(CONFIGURABLE_REST_TEMPLATE)
-    private RestTemplate testRestTemplate;
+    @Qualifier(ETSI_CATALOG_REST_TEMPLATE_BEAN)
+    private RestTemplate restTemplate;
 
     @Autowired
-    private TestRestTemplate restTemplate;
+    private TestRestTemplate testRestTemplate;
 
     private static final String VNF_PACKAGE_ID = "myVnfPackageId";
     private static final String ARTIFACT_PATH = "myArtifactPath";
@@ -104,8 +104,7 @@
 
     @Before
     public void setUp() {
-        final MockRestServiceServer.MockRestServiceServerBuilder builder =
-                MockRestServiceServer.bindTo(testRestTemplate);
+        final MockRestServiceServer.MockRestServiceServerBuilder builder = MockRestServiceServer.bindTo(restTemplate);
         builder.ignoreExpectOrder(true);
         mockRestServer = builder.build();
         basicHttpHeadersProvider = new BasicHttpHeadersProvider();
@@ -123,7 +122,7 @@
                 + VNF_PACKAGE_ID + "/package_content";
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
         final ResponseEntity<byte[]> responseEntity =
-                restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+                testRestTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
 
         assertEquals(byte[].class, responseEntity.getBody().getClass());
         assertArrayEquals(responseEntity.getBody(), responseArray);
@@ -164,7 +163,7 @@
 
 
         final ResponseEntity<ProblemDetails> responseEntity =
-                restTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
+                testRestTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
 
         assertTrue(responseEntity.getBody() instanceof ProblemDetails);
         assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
@@ -226,7 +225,7 @@
                 + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH;
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
         final ResponseEntity<byte[]> responseEntity =
-                restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+                testRestTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
 
         assertEquals(byte[].class, responseEntity.getBody().getClass());
         assertArrayEquals(responseEntity.getBody(), responseArray);
@@ -267,7 +266,7 @@
 
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
         final ResponseEntity<ProblemDetails> responseEntity =
-                restTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
+                testRestTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
 
         assertNotNull(responseEntity.getBody());
         assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
@@ -331,7 +330,7 @@
         final String testURL = localhostUrl + port + VNFPKGM_BASE_URL;
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
 
-        final ResponseEntity<InlineResponse2001[]> responseEntity = restTemplate.withBasicAuth("test", "test")
+        final ResponseEntity<InlineResponse2001[]> responseEntity = testRestTemplate.withBasicAuth("test", "test")
                 .exchange(testURL, HttpMethod.GET, request, InlineResponse2001[].class);
 
         assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
@@ -412,7 +411,7 @@
 
         final String testURL = localhostUrl + port + VNFPKGM_BASE_URL + "/" + VNF_PACKAGE_ID;
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
-        final ResponseEntity<InlineResponse2001> responseEntity = restTemplate.withBasicAuth("test", "test")
+        final ResponseEntity<InlineResponse2001> responseEntity = testRestTemplate.withBasicAuth("test", "test")
                 .exchange(testURL, HttpMethod.GET, request, InlineResponse2001.class);
 
         assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
@@ -484,7 +483,8 @@
                 + VNF_PACKAGE_ID + "\" \n" + "endpoint.", problemDetails.getDetail());
     }
 
-    // The below test method is here to improve code coverage and provide a foundation for writing future tests
+    // The below test method is here to improve code coverage and provide a foundation for writing
+    // future tests
     @Test
     public void testGetPackageVnfd_ValidArray_Success() {
         final byte[] responseArray = buildByteArrayWithRandomData(10);
@@ -497,7 +497,7 @@
                 "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/" + VNF_PACKAGE_ID + "/vnfd";
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
         final ResponseEntity<byte[]> responseEntity =
-                restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+                testRestTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
 
         assertEquals(byte[].class, responseEntity.getBody().getClass());
         assertArrayEquals(responseEntity.getBody(), responseArray);
@@ -592,7 +592,7 @@
     private ResponseEntity<ProblemDetails> sendHttpRequest(final String url) {
         final String testURL = localhostUrl + port + VNFPKGM_BASE_URL + "/" + url;
         final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
-        return restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request,
+        return testRestTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request,
                 ProblemDetails.class);
     }
 
@@ -652,4 +652,5 @@
         final VNFPKGMLinkSerializer vnfpkgmLinkSerializer = new VNFPKGMLinkSerializer().self(uriLink);
         return vnfpkgmLinkSerializer;
     }
+
 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java
index a2828b1..c269af8 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java
@@ -28,7 +28,7 @@
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL;
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
@@ -102,7 +102,7 @@
     private static final String LOCALHOST_URL = "http://localhost:";
 
     @Autowired
-    @Qualifier(CONFIGURABLE_REST_TEMPLATE)
+    @Qualifier(ETSI_CATALOG_REST_TEMPLATE_BEAN)
     private RestTemplate restTemplate;
     private MockRestServiceServer mockRestServiceServer;
     @Autowired
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceDecomposition.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceDecomposition.java
index 3632d18..70c7847 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceDecomposition.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/ServiceDecomposition.java
@@ -23,10 +23,6 @@
 package org.onap.so.bpmn.core.domain;
 
 
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonRootName;
@@ -35,6 +31,10 @@
 import org.onap.so.bpmn.core.json.JsonDecomposingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 
 
@@ -71,6 +71,10 @@
     private List<AllottedResource> allottedResources;
     @JsonProperty("configResource")
     private List<ConfigResource> configResources;
+    @JsonProperty("serviceInfo")
+    private ServiceInfo serviceInfo;
+    @JsonProperty("serviceProxy")
+    private List<ServiceProxy> serviceProxy;
 
     public ServiceDecomposition() {
         super();
@@ -85,6 +89,8 @@
         this.serviceRole = serviceDecomposition.getServiceRole();
         this.serviceType = serviceDecomposition.getServiceType();
         this.configResources = serviceDecomposition.getConfigResources();
+        this.serviceProxy = serviceDecomposition.getServiceProxy();
+        this.serviceInfo = serviceDecomposition.getServiceInfo();
     }
 
     /**
@@ -109,11 +115,13 @@
 
         this.project = serviceDecomposition.getProject();
         this.owningEntity = serviceDecomposition.getOwningEntity();
+        this.serviceProxy = serviceDecomposition.getServiceProxy();
+        this.serviceInfo = serviceDecomposition.getServiceInfo();
     }
 
     /**
      * Constructor taking a Service Decomposition JSON serialization
-     * 
+     *
      * @param catalogRestOutput
      * @param serviceInstanceId
      */
@@ -128,7 +136,7 @@
      * Return just the service model portion of the Service Decomposition as a Java object. The service model object
      * should support retrieval as JSON string that is formatted correctly for sending serviceModelInfo to Building
      * Blocks.
-     * 
+     *
      * @return
      */
     public ModelInfo getModelInfo() {
@@ -235,6 +243,22 @@
         this.sdncVersion = sdncVersion;
     }
 
+    public ServiceInfo getServiceInfo() {
+        return serviceInfo;
+    }
+
+    public void setServiceInfo(ServiceInfo serviceInfo) {
+        this.serviceInfo = serviceInfo;
+    }
+
+    public List<ServiceProxy> getServiceProxy() {
+        return serviceProxy;
+    }
+
+    public void setServiceProxy(List<ServiceProxy> serviceProxy) {
+        this.serviceProxy = serviceProxy;
+    }
+
     // *****
 
     // *****
@@ -243,7 +267,7 @@
 
     /**
      * This method returns one combined list of Resources of All Types
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -275,7 +299,7 @@
 
     /**
      * Returns a JSON list of all Network Resource structures (i.e. the serialized NetworkDecomposition objects).
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -285,7 +309,7 @@
 
     /**
      * Returns a JSON list of all VnfResource structures (i.e. the serialized VnfResource objects).
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -295,7 +319,7 @@
 
     /**
      * Returns a JSON list of all Allotted Resource structures (i.e. the serialized AllottedResource objects).
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -305,7 +329,7 @@
 
     /**
      * Returns a JSON list of all Config Resource structures (i.e. the serialized ConfigResource objects).
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -328,7 +352,7 @@
     // Methods to add Resource to the list
     /**
      * Add VNF resource to the list
-     * 
+     *
      * @param vnfResource
      */
     public void addVnfResource(Resource vnfResource) {
@@ -340,7 +364,7 @@
 
     /**
      * Add Network resource to the list
-     * 
+     *
      * @param networkResource
      */
     public void addNetworkResource(Resource networkResource) {
@@ -352,7 +376,7 @@
 
     /**
      * Add Allotted resource to the list
-     * 
+     *
      * @param allottedResource
      */
     public void addAllottedResource(Resource allottedResource) {
@@ -364,7 +388,7 @@
 
     /**
      * Add Config resource to the list
-     * 
+     *
      * @param allottedResource
      */
     public void addConfigResource(Resource configResource) {
@@ -378,7 +402,7 @@
      * Add resource to the list Given a ResourceDecomposition (subclass) object, add it to the Service Decomposition (in
      * the appropriate category, e.g. as a VNF, Network, or Allotted Resource). As dependencies are not currently
      * supported, add it to the end of any ordered lists.
-     * 
+     *
      * @param resource
      */
     public void addResource(Resource resource) {
@@ -403,7 +427,7 @@
 
     /**
      * Add resource to the list
-     * 
+     *
      * @param jsonResource
      */
     public void addVnfResource(String jsonResource) throws JsonDecomposingException {
@@ -414,7 +438,7 @@
 
     /**
      * Add resource to the list
-     * 
+     *
      * @param jsonResource
      */
     public void addNetworkResource(String jsonResource) throws JsonDecomposingException {
@@ -425,7 +449,7 @@
 
     /**
      * Add resource to the list
-     * 
+     *
      * @param Resource
      */
     public void addAllottedResource(String jsonResource) throws JsonDecomposingException {
@@ -436,7 +460,7 @@
 
     /**
      * Add resource to the list
-     * 
+     *
      * @param Resource
      */
     public void addConfigResource(String jsonResource) throws JsonDecomposingException {
@@ -449,7 +473,7 @@
      * Given a ResourceDecomposition (subclass) object, locate it in the Service Decomposition by its unique ID, and
      * replace the current version with the new one. This method should support concurrency control via an
      * auto-incrementing field in the ResourceDecomposition class.
-     * 
+     *
      * @param newResource
      * @return TRUE if replacement was a success
      */
@@ -474,7 +498,7 @@
     /**
      * Given a ResourceDecomposition as a JSON string, locate it in the Service Decomposition by its unique ID, and
      * replace the current version with the new one.
-     * 
+     *
      * @param jsonString
      * @return
      */
@@ -485,7 +509,7 @@
 
     /**
      * Given a resource object ID, locate it in the Service Decomposition by its unique ID, and delete it.
-     * 
+     *
      * @param resource
      * @return TRUE if delete was a success
      */
@@ -503,7 +527,7 @@
 
     /**
      * Generic method to get List of Resource objects based on input resource's resourceType
-     * 
+     *
      * @param resource
      * @return List matching the resourceType of resource
      */
@@ -530,7 +554,7 @@
 
     /**
      * Generic method to set List of ResourceDecomposition objects
-     * 
+     *
      * @param resources
      * @return
      */
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index f8a4d91..eead176 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -169,12 +169,7 @@
     }
 
     public void selectExecutionList(DelegateExecution execution) throws Exception {
-        final String requestAction = (String) execution.getVariable(BBConstants.G_ACTION);
-        final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
-        final String bpmnRequest = (String) execution.getVariable(BBConstants.G_BPMN_REQUEST);
-        final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE);
         final String apiVersion = (String) execution.getVariable(BBConstants.G_APIVERSION);
-        String uri = (String) execution.getVariable(BBConstants.G_URI);
         final String vnfType = (String) execution.getVariable(VNF_TYPE);
         String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
         final String createInstanceAction = "createInstance";
@@ -183,40 +178,34 @@
 
         List<OrchestrationFlow> orchFlows =
                 (List<OrchestrationFlow>) execution.getVariable(BBConstants.G_ORCHESTRATION_FLOW);
-        List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
         WorkflowResourceIds workflowResourceIds = populateResourceIdsFromApiHandler(execution);
         List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
         List<Resource> resourceList = new ArrayList<>();
         execution.setVariable("sentSyncResponse", false);
         execution.setVariable("homing", false);
         execution.setVariable("calledHoming", false);
+        execution.setVariable(BBConstants.G_ISTOPLEVELFLOW, true);
 
         try {
-            ObjectMapper mapper = new ObjectMapper();
-            execution.setVariable(BBConstants.G_ISTOPLEVELFLOW, true);
-            ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
+            final String bpmnRequest = (String) execution.getVariable(BBConstants.G_BPMN_REQUEST);
+            ServiceInstancesRequest sIRequest =
+                    new ObjectMapper().readValue(bpmnRequest, ServiceInstancesRequest.class);
             RequestDetails requestDetails = sIRequest.getRequestDetails();
-            boolean suppressRollback = false;
-            try {
-                suppressRollback = requestDetails.getRequestInfo().getSuppressRollback();
-            } catch (Exception ex) {
-                logger.warn("Exception in getSuppressRollback", ex);
-                suppressRollback = false;
-            }
-            execution.setVariable("suppressRollback", suppressRollback);
-            boolean isResume = false;
-            if (isUriResume(uri)) {
-                isResume = true;
-                if (!aLaCarte) {
-                    logger.debug("replacing URI {}", uri);
-                    uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl();
-                    logger.debug("for RESUME with original value {}", uri);
-                }
+            execution.setVariable("suppressRollback", requestDetails.getRequestInfo().getSuppressRollback());
+            String uri = (String) execution.getVariable(BBConstants.G_URI);
+            final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
+            final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE);
+            boolean isResume = isUriResume(uri);
+            if (!aLaCarte && isResume) {
+                logger.debug("replacing URI {}", uri);
+                uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl();
+                logger.debug("for RESUME with original value {}", uri);
             }
             Resource resource = extractResourceIdAndTypeFromUri(uri);
             WorkflowType resourceType = resource.getResourceType();
             execution.setVariable("resourceName", resourceType.toString());
             String resourceId = "";
+            final String requestAction = (String) execution.getVariable(BBConstants.G_ACTION);
             if (resource.isGenerated() && requestAction.equalsIgnoreCase(createInstanceAction)
                     && sIRequest.getRequestDetails().getRequestInfo().getInstanceName() != null) {
                 resourceId = validateResourceIdInAAI(resource.getResourceId(), resourceType,
@@ -230,7 +219,7 @@
             }
             execution.setVariable("resourceId", resourceId);
             execution.setVariable("resourceType", resourceType);
-
+            List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
             if (isRequestMacroServiceResume(aLaCarte, resourceType, requestAction, serviceInstanceId)) {
                 flowsToExecute = bbInputSetupUtils.loadOriginalFlowExecutionPath(requestId);
                 if (flowsToExecute == null) {
diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
index b231ded..3a9ec37 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -42,20 +42,20 @@
             </goals>
             <configuration>
               <source>
-								println 'Project version: ' + project.properties['so.project.version'];
-								def versionArray;
-								if ( project.properties['so.project.version'] != null ) {
-									versionArray = project.properties['so.project.version'].split('-');
-								}
+                println 'Project version: ' + project.properties['so.project.version'];
+                def versionArray;
+                if ( project.properties['so.project.version'] != null ) {
+                  versionArray = project.properties['so.project.version'].split('-');
+                }
 
-								if ( project.properties['so.project.version'].endsWith("-SNAPSHOT") ) {
-									project.properties['project.docker.latesttag.version']=versionArray[0] + "-SNAPSHOT-latest";
-								} else {
-									project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest";
-								}
+                if ( project.properties['so.project.version'].endsWith("-SNAPSHOT") ) {
+                  project.properties['project.docker.latesttag.version']=versionArray[0] + "-SNAPSHOT-latest";
+                } else {
+                  project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest";
+                }
 
-								println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
-							</source>
+                println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
+              </source>
             </configuration>
           </execution>
         </executions>
