diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
index 56d4257..7e866f9 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
@@ -44,6 +44,7 @@
                                 <sourceFolder>src/gen/java/main</sourceFolder>
                                 <withXml>true</withXml>
                                 <useRxJava2>true</useRxJava2>
+                                <serializableModel>true</serializableModel>
                             </configOptions>
                         </configuration>
                     </execution>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn
new file mode 100644
index 0000000..9b98620
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0x13ohc" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3">
+  <bpmn:process id="EtsiVnfInstantiateBB" name="&#10;EtsiVnfInstantiateBB" isExecutable="true">
+    <bpmn:serviceTask id="ServiceTask_02e82t2" name="Create &#10;CreateVnfRequest&#10;" camunda:expression="${VnfmAdapterCreateVnfTask.buildCreateVnfRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_016sgof</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0f0vsnv</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:startEvent id="StartEvent_0ru3x55">
+      <bpmn:outgoing>SequenceFlow_016sgof</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_016sgof" sourceRef="StartEvent_0ru3x55" targetRef="ServiceTask_02e82t2" />
+    <bpmn:endEvent id="EndEvent_001k15i">
+      <bpmn:incoming>SequenceFlow_0cik89t</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0f0vsnv" sourceRef="ServiceTask_02e82t2" targetRef="ServiceTask_06ao4xu" />
+    <bpmn:serviceTask id="ServiceTask_06ao4xu" name="&#10;Invoke VNFM Adaptor&#10;" camunda:asyncAfter="true" camunda:expression="${VnfmAdapterCreateVnfTask.invokeVnfmAdapter(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_0f0vsnv</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cik89t</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cik89t" sourceRef="ServiceTask_06ao4xu" targetRef="EndEvent_001k15i" />
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="EtsiVnfInstantiateBB">
+      <bpmndi:BPMNShape id="ServiceTask_02e82t1_di" bpmnElement="ServiceTask_02e82t2">
+        <dc:Bounds x="353" y="227" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="StartEvent_0ru3x55_di" bpmnElement="StartEvent_0ru3x55">
+        <dc:Bounds x="232" y="249" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_016sgof_di" bpmnElement="SequenceFlow_016sgof">
+        <di:waypoint x="268" y="267" />
+        <di:waypoint x="353" y="267" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="EndEvent_001k15i_di" bpmnElement="EndEvent_001k15i">
+        <dc:Bounds x="703" y="249" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0f0vsnv_di" bpmnElement="SequenceFlow_0f0vsnv">
+        <di:waypoint x="453" y="267" />
+        <di:waypoint x="522" y="267" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_06ao4xu_di" bpmnElement="ServiceTask_06ao4xu">
+        <dc:Bounds x="522" y="227" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cik89t_di" bpmnElement="SequenceFlow_0cik89t">
+        <di:waypoint x="622" y="267" />
+        <di:waypoint x="703" y="267" />
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-tasks/pom.xml b/bpmn/so-bpmn-tasks/pom.xml
index 0243ce8..ce1cdd5 100644
--- a/bpmn/so-bpmn-tasks/pom.xml
+++ b/bpmn/so-bpmn-tasks/pom.xml
@@ -1,150 +1,160 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<groupId>org.onap.so</groupId>
-		<artifactId>bpmn</artifactId>
-		<version>1.4.0-SNAPSHOT</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>so-bpmn-tasks</artifactId>
-	<packaging>jar</packaging>
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-		<maven.compiler.target>1.8</maven.compiler.target>
-		<maven.compiler.source>1.8</maven.compiler.source>
-	</properties>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>default-test</id>
-						<goals>
-							<goal>test</goal>
-						</goals>
-						<configuration>
-							<includes>
-								<include>**/UnitTestSuite.java</include>
-							</includes>
-						</configuration>
-					</execution>
-					<execution>
-						<id>integration-test</id>
-						<goals>
-							<goal>test</goal>
-						</goals>
-						<configuration>
-							<includes>
-								<include>**/IntegrationTestSuite.java</include>
-							</includes>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>io.swagger</groupId>
-				<artifactId>swagger-codegen-maven-plugin</artifactId>
-				<version>2.3.1</version>
-				<executions>
-					<execution>
-						<goals>
-							<goal>generate</goal>
-						</goals>
-						<configuration>
-							<inputSpec>${project.basedir}/src/main/resources/naming-service/swagger.json</inputSpec>
-							<apiPackage>org.onap.namingservice.api</apiPackage>
-							<modelPackage>org.onap.namingservice.model</modelPackage>
-							<invokerPackage>org.onap.namingservice.invoker</invokerPackage>
-						</configuration>
-					</execution>
-				</executions>
-				<configuration>
-					<inputSpec>${project.basedir}/src/main/resources/swagger.json</inputSpec>
-					<language>java</language>
-					<configOptions>
-						<sourceFolder>src/gen/java/main</sourceFolder>
-						<serializableModel>true</serializableModel>
-					</configOptions>
-					<output>${project.build.directory}/generated-sources</output>
-					<generateApis>false</generateApis>
-					<library>jersey2</library>
-					<generateSupportingFiles>false</generateSupportingFiles>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<!-- Import dependency management from Spring Boot -->
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-dependencies</artifactId>
-				<version>${springboot.version}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.camunda.bpm.springboot</groupId>
-			<artifactId>camunda-bpm-spring-boot-starter</artifactId>
-			<version>${camunda.springboot.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-wiremock</artifactId>
-			<version>1.2.4.RELEASE</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-test</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.camunda.bpm.extension.mockito</groupId>
-			<artifactId>camunda-bpm-mockito</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.so</groupId>
-			<artifactId>MSOCommonBPMN</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.so</groupId>
-			<artifactId>so-bpmn-infrastructure-common</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.so.adapters</groupId>
-			<artifactId>mso-adapter-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.sdnc.northbound</groupId>
-			<artifactId>generic-resource-api-client</artifactId>
-			<version>1.5.0-SNAPSHOT</version>
-			<exclusions>
-				<exclusion>
-					<groupId>javax.ws.rs</groupId>
-					<artifactId>jsr311-api</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>ch.vorburger.mariaDB4j</groupId>
-			<artifactId>mariaDB4j</artifactId>
-			<version>2.2.3</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-		</dependency>
-	</dependencies>
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.onap.so</groupId>
+        <artifactId>bpmn</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>so-bpmn-tasks</artifactId>
+    <packaging>jar</packaging>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.compiler.source>1.8</maven.compiler.source>
+    </properties>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-test</id>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                        <configuration>
+                            <includes>
+                                <include>**/UnitTestSuite.java</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>integration-test</id>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                        <configuration>
+                            <includes>
+                                <include>**/IntegrationTestSuite.java</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>2.3.1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${project.basedir}/src/main/resources/naming-service/swagger.json</inputSpec>
+                            <apiPackage>org.onap.namingservice.api</apiPackage>
+                            <modelPackage>org.onap.namingservice.model</modelPackage>
+                            <invokerPackage>org.onap.namingservice.invoker</invokerPackage>
+                        </configuration>
+                    </execution>
+                </executions>
+                <configuration>
+                    <inputSpec>${project.basedir}/src/main/resources/swagger.json</inputSpec>
+                    <language>java</language>
+                    <configOptions>
+                        <sourceFolder>src/gen/java/main</sourceFolder>
+                        <serializableModel>true</serializableModel>
+                    </configOptions>
+                    <output>${project.build.directory}/generated-sources</output>
+                    <generateApis>false</generateApis>
+                    <library>jersey2</library>
+                    <generateSupportingFiles>false</generateSupportingFiles>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <!-- Import dependency management from Spring Boot -->
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${springboot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.camunda.bpm.springboot</groupId>
+            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
+            <version>${camunda.springboot.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-contract-wiremock</artifactId>
+            <version>1.2.4.RELEASE</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.camunda.bpm.extension.mockito</groupId>
+            <artifactId>camunda-bpm-mockito</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.so</groupId>
+            <artifactId>MSOCommonBPMN</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.so</groupId>
+            <artifactId>so-bpmn-infrastructure-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.so.adapters</groupId>
+            <artifactId>mso-adapter-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.sdnc.northbound</groupId>
+            <artifactId>generic-resource-api-client</artifactId>
+            <version>1.5.0-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.ws.rs</groupId>
+                    <artifactId>jsr311-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>ch.vorburger.mariaDB4j</groupId>
+            <artifactId>mariaDB4j</artifactId>
+            <version>2.2.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.so.adapters</groupId>
+            <artifactId>mso-vnfm-adapter-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
 </project>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index 4237a50..bc6770c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -532,7 +532,7 @@
 	
 	public void updateOrchestrationStatusConfigAssignedVnf(BuildingBlockExecution execution) {
 		try {
-			GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
+			GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
 			aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGASSIGNED);
 		} catch (Exception ex) {
 			exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
new file mode 100644
index 0000000..d03173d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class Constants {
+
+    public static final String CREATE_VNF_REQUEST_PARAM_NAME = "createVnfRequest";
+    public static final String CREATE_VNF_RESPONSE_PARAM_NAME = "createVnfResponse";
+
+    public static final String DOT = ".";
+    public static final String UNDERSCORE = "_";
+    public static final String SPACE = "\\s+";
+
+    public static final String VNFM_ADAPTER_DEFAULT_URL = "http://so-vnfm-adapter.onap:9092/so/vnfm-adapter/v1/";
+    public static final String VNFM_ADAPTER_DEFAULT_AUTH = "Basic dm5mbTpwYXNzd29yZDEk";
+
+
+    private Constants() {}
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java
new file mode 100644
index 0000000..23ddb6f
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java
@@ -0,0 +1,150 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_REQUEST_PARAM_NAME;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_RESPONSE_PARAM_NAME;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DOT;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.SPACE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.UNDERSCORE;
+import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.onap.vnfmadapter.v1.model.Tenant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.common.base.Optional;
+
+/**
+ * This class is executed from EtsiVnfInstantiateBB building block and it sends the create request
+ * to the VNFM adapter
+ * 
+ * @author waqas.ikram@est.tech
+ */
+@Component
+public class VnfmAdapterCreateVnfTask {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(VnfmAdapterCreateVnfTask.class);
+
+    private final ExtractPojosForBB extractPojosForBB;
+    private final ExceptionBuilder exceptionUtil;
+    private final VnfmAdapterServiceProvider vnfmAdapterServiceProvider;
+
+    @Autowired
+    public VnfmAdapterCreateVnfTask(final ExceptionBuilder exceptionUtil, final ExtractPojosForBB extractPojosForBB,
+            final VnfmAdapterServiceProvider vnfmAdapterServiceProvider) {
+        this.exceptionUtil = exceptionUtil;
+        this.extractPojosForBB = extractPojosForBB;
+        this.vnfmAdapterServiceProvider = vnfmAdapterServiceProvider;
+    }
+
+    /**
+     * Create {@link CreateVnfRequest} object with required fields and store it in
+     * {@link org.camunda.bpm.engine.delegate.DelegateExecution}
+     * 
+     * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
+     */
+    public void buildCreateVnfRequest(final BuildingBlockExecution execution) {
+        try {
+            LOGGER.debug("Executing buildCreateVnfRequest  ...");
+
+            final GeneralBuildingBlock buildingBlock = execution.getGeneralBuildingBlock();
+            final CloudRegion cloudRegion = buildingBlock.getCloudRegion();
+
+            final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+            final ModelInfoGenericVnf modelInfoGenericVnf = vnf.getModelInfoGenericVnf();
+
+            final CreateVnfRequest createVnfRequest = new CreateVnfRequest();
+
+            createVnfRequest.setName(getName(vnf.getVnfName(), modelInfoGenericVnf.getModelInstanceName()));
+            createVnfRequest.setTenant(getTenant(cloudRegion));
+
+            LOGGER.info("CreateVnfRequest : {}", createVnfRequest);
+
+            execution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, createVnfRequest);
+
+            LOGGER.debug("Finished executing buildCreateVnfRequest ...");
+        } catch (final Exception exception) {
+            LOGGER.error("Unable to execute buildCreateVnfRequest", exception);
+            exceptionUtil.buildAndThrowWorkflowException(execution, 1200, exception);
+        }
+    }
+
+    /**
+     * Invoke VNFM adapter to create and instantiate VNF
+     * 
+     * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
+     */
+    public void invokeVnfmAdapter(final BuildingBlockExecution execution) {
+        try {
+            LOGGER.debug("Executing invokeVnfmAdapter  ...");
+            final CreateVnfRequest request = execution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
+
+            final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+
+            final Optional<CreateVnfResponse> response =
+                    vnfmAdapterServiceProvider.invokeCreateInstantiationRequest(vnf.getVnfId(), request);
+
+            if (!response.isPresent()) {
+                final String errorMessage = "Unexpected error while processing create and instantiation request";
+                LOGGER.error(errorMessage);
+                exceptionUtil.buildAndThrowWorkflowException(execution, 1201, errorMessage);
+            }
+
+            final CreateVnfResponse vnfResponse = response.get();
+
+            LOGGER.debug("Vnf instantiation response: {}", vnfResponse);
+            execution.setVariable(CREATE_VNF_RESPONSE_PARAM_NAME, vnfResponse);
+
+            LOGGER.debug("Finished executing invokeVnfmAdapter ...");
+        } catch (final Exception exception) {
+            LOGGER.error("Unable to invoke create and instantiation request", exception);
+            exceptionUtil.buildAndThrowWorkflowException(execution, 1202, exception);
+        }
+    }
+
+    private Tenant getTenant(final CloudRegion cloudRegion) {
+        final Tenant tenant = new Tenant();
+        tenant.setCloudOwner(cloudRegion.getCloudOwner());
+        tenant.setRegionName(cloudRegion.getLcpCloudRegionId());
+        tenant.setTenantId(cloudRegion.getTenantId());
+        return tenant;
+    }
+
+    private String getName(final String vnfName, final String modelInstanceName) {
+        if (modelInstanceName != null) {
+            return (vnfName + DOT + modelInstanceName).replaceAll(SPACE, UNDERSCORE);
+        }
+        return vnfName != null ? vnfName.replaceAll(SPACE, UNDERSCORE) : vnfName;
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java
new file mode 100644
index 0000000..1046b6b
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+
+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.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * Provides {@link org.onap.so.rest.service.VnfmAdapterServiceProvider} configuration for
+ * {@link VnfmAdapterCreateVnfTask}
+ * 
+ * @author waqas.ikram@est.tech
+ */
+@Configuration
+public class VnfmAdapterCreateVnfTaskConfiguration {
+
+    @Bean
+    public HttpRestServiceProvider databaseHttpRestServiceProvider(
+            @Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate,
+            @Autowired final VnfmBasicHttpConfigProvider etsiVnfmAdapter) {
+        return getHttpRestServiceProvider(restTemplate, new BasicHttpHeadersProvider(etsiVnfmAdapter.getAuth()));
+    }
+
+    private HttpRestServiceProvider getHttpRestServiceProvider(final RestTemplate restTemplate,
+            final HttpHeadersProvider httpHeadersProvider) {
+        return new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
+    }
+
+}
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
similarity index 63%
copy from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java
copy to bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
index 4606c04..02303ef 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
@@ -1,33 +1,38 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * 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.monitoring.rest.service;
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
 
 import com.google.common.base.Optional;
 
+
 /**
- * @author waqas.ikram@ericsson.com
+ * Provide a service which interacts with VNFM adapter for instantiating, monitoring VNF
+ * 
+ * @author waqas.ikram@est.tech
  */
-public interface HttpRestServiceProvider {
+public interface VnfmAdapterServiceProvider {
 
-    public <T> Optional<T> getHttpResponse(final String url, final Class<T> clazz);
-
-    public <T> Optional<T> postHttpRequest(final Object object, final String url, final Class<T> clazz);
+    Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId, final CreateVnfRequest request);
 
 }
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
new file mode 100644
index 0000000..afdcccf
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import com.google.common.base.Optional;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+@Service
+public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvider {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(VnfmAdapterServiceProviderImpl.class);
+
+    private final VnfmAdapterUrlProvider urlProvider;
+    private final HttpRestServiceProvider httpServiceProvider;
+
+    @Autowired
+    public VnfmAdapterServiceProviderImpl(final VnfmAdapterUrlProvider urlProvider,
+            final HttpRestServiceProvider httpServiceProvider) {
+        this.urlProvider = urlProvider;
+        this.httpServiceProvider = httpServiceProvider;
+    }
+
+    @Override
+    public Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId,
+            final CreateVnfRequest request) {
+        try {
+            final String url = urlProvider.getCreateInstantiateUrl(vnfId);
+
+            final ResponseEntity<CreateVnfResponse> response =
+                    httpServiceProvider.postHttpRequest(request, url, CreateVnfResponse.class);
+
+            final HttpStatus httpStatus = response.getStatusCode();
+            if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) {
+                LOGGER.error("Unable to invoke HTTP POST using URL: {}, Response Code: {}", url, httpStatus.value());
+                return Optional.absent();
+            }
+
+            if (!response.hasBody()) {
+                LOGGER.error("Received response without body: {}", response);
+                return Optional.absent();
+            }
+
+            final CreateVnfResponse createVnfResponse = response.getBody();
+
+            if (createVnfResponse.getJobId() == null || createVnfResponse.getJobId().isEmpty()) {
+                LOGGER.error("Received invalid instantiation response: {}", response);
+                return Optional.absent();
+            }
+
+            return Optional.of(createVnfResponse);
+        } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
+            LOGGER.error("Unexpected error while processing create and instantiation request", httpInvocationException);
+            return Optional.absent();
+        }
+
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java
new file mode 100644
index 0000000..03ee071
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import java.net.URI;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.util.UriComponentsBuilder;
+
+/**
+ * 
+ * Provides VNFM adapter {@link java.net.URL}
+ * 
+ * @author waqas.ikram@est.tech
+ *
+ */
+@Service
+public class VnfmAdapterUrlProvider {
+
+    private final URI baseUri;
+
+    @Autowired
+    public VnfmAdapterUrlProvider(final VnfmBasicHttpConfigProvider etsiVnfmAdapter) {
+        this.baseUri = UriComponentsBuilder.fromHttpUrl(etsiVnfmAdapter.getUrl()).build().toUri();
+    }
+
+    /**
+     * Get VNFM create and instantiate URL
+     * 
+     * @param vnfId The identifier of the VNF. This must be the vnf-id of an existing generic-vnf in
+     *        AAI.
+     * @return VNFM create and instantiate URL
+     */
+    public String getCreateInstantiateUrl(final String vnfId) {
+        return UriComponentsBuilder.fromUri(baseUri).pathSegment("vnfs").pathSegment(vnfId).build().toString();
+    }
+
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmBasicHttpConfigProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmBasicHttpConfigProvider.java
new file mode 100644
index 0000000..c9b1ad1
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmBasicHttpConfigProvider.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNFM_ADAPTER_DEFAULT_AUTH;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNFM_ADAPTER_DEFAULT_URL;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Provides VNFM adapter {@link java.net.URI} and basic authorization values
+ * 
+ * @author waqas.ikram@est.tech
+ */
+@Configuration
+@ConfigurationProperties(prefix = "so.vnfm.adapter")
+public class VnfmBasicHttpConfigProvider {
+
+    private String url = VNFM_ADAPTER_DEFAULT_URL;
+
+    private String auth = VNFM_ADAPTER_DEFAULT_AUTH;
+
+    /**
+     * @return the url
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * @param url the url to set
+     */
+    public void setUrl(final String url) {
+        this.url = url;
+    }
+
+    /**
+     * @return the auth
+     */
+    public String getAuth() {
+        return auth;
+    }
+
+    /**
+     * @param auth the auth to set
+     */
+    public void setAuth(final String auth) {
+        this.auth = auth;
+    }
+
+    @Override
+    public String toString() {
+        return "EtsiVnfmAdapter [url=" + url + ", auth=" + auth + "]";
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
index 1304408..242135a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
@@ -65,10 +65,8 @@
     public void preProcessAbstractCDSProcessing(BuildingBlockExecution execution) {
         logger.info("Start preProcessAbstractCDSProcessing ");
         try {
-            GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID,
-                    execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
-            ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID,
-                    execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
+            GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+            ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
 
             Map<String, Object> userParams = execution.getGeneralBuildingBlock().getRequestContext().getUserParams();
 
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java
new file mode 100644
index 0000000..5451d44
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmBasicHttpConfigProvider;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class TestConstants {
+
+    public static final String DUMMY_GENERIC_VND_ID = "5956a99d-9736-11e8-8caf-022ac9304eeb";
+    public static final String DUMMY_BASIC_AUTH = "Basic 123abc";
+    public static final String DUMMY_URL = "http://localhost:30406/so/vnfm-adapter/v1/";
+    public static final String EXPECTED_URL = DUMMY_URL + "vnfs/" + DUMMY_GENERIC_VND_ID;
+
+    public static VnfmBasicHttpConfigProvider getVnfmBasicHttpConfigProvider() {
+        return getVnfmBasicHttpConfigProvider(DUMMY_URL, DUMMY_BASIC_AUTH);
+    }
+
+    public static VnfmBasicHttpConfigProvider getVnfmBasicHttpConfigProvider(final String url, final String auth) {
+        final VnfmBasicHttpConfigProvider vnfmBasicHttpConfigProvider = new VnfmBasicHttpConfigProvider();
+        vnfmBasicHttpConfigProvider.setUrl(url);
+        vnfmBasicHttpConfigProvider.setAuth(auth);
+        return vnfmBasicHttpConfigProvider;
+    }
+
+    private TestConstants() {}
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfigurationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfigurationTest.java
new file mode 100644
index 0000000..5aaebea
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfigurationTest.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertNotNull;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getVnfmBasicHttpConfigProvider;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterCreateVnfTaskConfiguration;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class VnfmAdapterCreateVnfTaskConfigurationTest {
+
+    @Mock
+    private RestTemplate restTemplate;
+
+    @Test
+    public void test_databaseHttpRestServiceProvider_httpRestServiceProviderNotNull() {
+        final VnfmAdapterCreateVnfTaskConfiguration objUnderTest = new VnfmAdapterCreateVnfTaskConfiguration();
+
+        final HttpRestServiceProvider actual =
+                objUnderTest.databaseHttpRestServiceProvider(restTemplate, getVnfmBasicHttpConfigProvider());
+        assertNotNull(actual);
+
+
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
new file mode 100644
index 0000000..ddfc08e
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
@@ -0,0 +1,248 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_REQUEST_PARAM_NAME;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_RESPONSE_PARAM_NAME;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.junit.Test;
+import org.mockito.Mock;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterCreateVnfTask;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProvider;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.onap.vnfmadapter.v1.model.Tenant;
+
+import com.google.common.base.Optional;
+
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class VnfmAdapterCreateVnfTaskTest extends BaseTaskTest {
+
+    private static final String MODEL_INSTANCE_NAME = "MODEL_INSTANCE_NAME";
+
+    private static final String CLOUD_OWNER = "CLOUD_OWNER";
+
+    private static final String LCP_CLOUD_REGIONID = "RegionOnce";
+
+    private static final String TENANT_ID = UUID.randomUUID().toString();
+
+    private static final String VNF_ID = UUID.randomUUID().toString();
+
+    private static final String VNF_NAME = "VNF_NAME";
+
+    private static final String JOB_ID = UUID.randomUUID().toString();
+
+    @Mock
+    private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+
+    private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+    @Test
+    public void testBuildCreateVnfRequest_withValidValues_storesRequestInExecution() throws Exception {
+
+        final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+
+        when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+        objUnderTest.buildCreateVnfRequest(stubbedxecution);
+
+        final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
+        assertNotNull(actual);
+        assertEquals(VNF_NAME + "." + MODEL_INSTANCE_NAME, actual.getName());
+
+        final Tenant actualTenant = actual.getTenant();
+        assertEquals(CLOUD_OWNER, actualTenant.getCloudOwner());
+        assertEquals(LCP_CLOUD_REGIONID, actualTenant.getRegionName());
+        assertEquals(TENANT_ID, actualTenant.getTenantId());
+
+    }
+
+    @Test
+    public void testBuildCreateVnfRequest_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
+
+        final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+
+        when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+
+        objUnderTest.buildCreateVnfRequest(stubbedxecution);
+
+        final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
+
+        assertNull(actual);
+        verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1200),
+                any(Exception.class));
+
+    }
+
+    @Test
+    public void testInvokeVnfmAdapter_validValues_storesResponseInExecution() throws Exception {
+
+        final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+
+        stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
+
+        when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+        when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
+                .thenReturn(getCreateVnfResponse());
+
+        objUnderTest.invokeVnfmAdapter(stubbedxecution);
+
+        assertNotNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+    }
+
+    @Test
+    public void testInvokeVnfmAdapter_invalidValues_storesResponseInExecution() throws Exception {
+
+        final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+
+        stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
+
+        when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+        when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
+                .thenReturn(Optional.absent());
+
+        objUnderTest.invokeVnfmAdapter(stubbedxecution);
+
+        assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+        verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
+                any(Exception.class));
+    }
+
+
+    @Test
+    public void testInvokeVnfmAdapter_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
+
+        final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+
+        when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+
+        objUnderTest.invokeVnfmAdapter(stubbedxecution);
+
+        assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+        verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
+                any(Exception.class));
+
+    }
+
+    private Optional<CreateVnfResponse> getCreateVnfResponse() {
+        final CreateVnfResponse response = new CreateVnfResponse();
+        response.setJobId(JOB_ID);
+        return Optional.of(response);
+    }
+
+    private GenericVnf getGenericVnf() {
+        final GenericVnf genericVnf = new GenericVnf();
+        genericVnf.setVnfId(VNF_ID);
+        genericVnf.setModelInfoGenericVnf(getModelInfoGenericVnf());
+        genericVnf.setVnfName(VNF_NAME);
+        return genericVnf;
+    }
+
+    private ModelInfoGenericVnf getModelInfoGenericVnf() {
+        final ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+        modelInfoGenericVnf.setModelInstanceName(MODEL_INSTANCE_NAME);
+        return modelInfoGenericVnf;
+    }
+
+    private VnfmAdapterCreateVnfTask getEtsiVnfInstantiateTask() {
+        return new VnfmAdapterCreateVnfTask(exceptionUtil, extractPojosForBB, mockedVnfmAdapterServiceProvider);
+    }
+
+    private class StubbedBuildingBlockExecution implements BuildingBlockExecution {
+
+        private final Map<String, Serializable> execution = new HashMap<>();
+        private final GeneralBuildingBlock generalBuildingBlock;
+
+        StubbedBuildingBlockExecution() {
+            generalBuildingBlock = getGeneralBuildingBlockValue();
+        }
+
+        @Override
+        public GeneralBuildingBlock getGeneralBuildingBlock() {
+            return generalBuildingBlock;
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public <T> T getVariable(final String key) {
+            return (T) execution.get(key);
+        }
+
+        @Override
+        public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
+            return null;
+        }
+
+        @Override
+        public void setVariable(final String key, final Serializable value) {
+            execution.put(key, value);
+        }
+
+        @Override
+        public Map<ResourceKey, String> getLookupMap() {
+            return Collections.emptyMap();
+        }
+
+        @Override
+        public String getFlowToBeCalled() {
+            return null;
+        }
+
+        private GeneralBuildingBlock getGeneralBuildingBlockValue() {
+            final GeneralBuildingBlock buildingBlock = new GeneralBuildingBlock();
+            buildingBlock.setCloudRegion(getCloudRegion());
+            return buildingBlock;
+        }
+
+        private CloudRegion getCloudRegion() {
+            final CloudRegion cloudRegion = new CloudRegion();
+            cloudRegion.setCloudOwner(CLOUD_OWNER);
+            cloudRegion.setLcpCloudRegionId(LCP_CLOUD_REGIONID);
+            cloudRegion.setTenantId(TENANT_ID);
+            return cloudRegion;
+        }
+
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
new file mode 100644
index 0000000..0f44391
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
@@ -0,0 +1,167 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.DUMMY_GENERIC_VND_ID;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getVnfmBasicHttpConfigProvider;
+
+import java.util.UUID;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProvider;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProviderImpl;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterUrlProvider;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import com.google.common.base.Optional;
+
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class VnfmAdapterServiceProviderImplTest {
+
+    private static final String EMPTY_JOB_ID = "";
+
+    private static final CreateVnfRequest CREATE_VNF_REQUEST = new CreateVnfRequest();
+
+    private static final String DUMMY_JOB_ID = UUID.randomUUID().toString();
+
+    @Mock
+    private HttpRestServiceProvider mockedHttpServiceProvider;
+
+    @Mock
+    private ResponseEntity<CreateVnfResponse> mockedResponseEntity;
+
+    @Test
+    public void testInvokeCreateInstantiationRequest_httpServiceProviderReturnsStatusAcceptedWithBody_validResponse() {
+
+        when(mockedHttpServiceProvider.postHttpRequest(eq(CREATE_VNF_REQUEST), anyString(),
+                eq(CreateVnfResponse.class))).thenReturn(mockedResponseEntity);
+        when(mockedResponseEntity.getStatusCode()).thenReturn(HttpStatus.ACCEPTED);
+        when(mockedResponseEntity.hasBody()).thenReturn(true);
+        final CreateVnfResponse response = getCreateVnfResponse(DUMMY_JOB_ID);
+        when(mockedResponseEntity.getBody()).thenReturn(response);
+
+
+        final VnfmAdapterServiceProvider objUnderTest =
+                new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+
+        final Optional<CreateVnfResponse> actual =
+                objUnderTest.invokeCreateInstantiationRequest(DUMMY_GENERIC_VND_ID, CREATE_VNF_REQUEST);
+        assertTrue(actual.isPresent());
+        assertEquals(actual.get(), response);
+
+    }
+
+    @Test
+    public void testInvokeCreateInstantiationRequest_httpServiceProviderReturnsStatusAcceptedWithNoBody_noResponse() {
+        assertWithStatuCode(HttpStatus.ACCEPTED);
+    }
+
+    @Test
+    public void testInvokeCreateInstantiationRequest_httpServiceProviderReturnsStatusNotOkWithNoBody_noResponse() {
+        assertWithStatuCode(HttpStatus.UNAUTHORIZED);
+    }
+
+
+    @Test
+    public void testInvokeCreateInstantiationRequest_httpServiceProviderReturnsStatusAcceptedWithBodyWithInvalidJobId_noResponse() {
+        assertWithJobId(null);
+        assertWithJobId(EMPTY_JOB_ID);
+    }
+
+    @Test
+    public void testInvokeCreateInstantiationRequest_httpServiceProviderThrowException_httpRestServiceProviderNotNull() {
+
+        when(mockedHttpServiceProvider.postHttpRequest(eq(CREATE_VNF_REQUEST), anyString(),
+                eq(CreateVnfResponse.class))).thenThrow(RestProcessingException.class);
+
+
+        final VnfmAdapterServiceProvider objUnderTest =
+                new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+
+        final Optional<CreateVnfResponse> actual =
+                objUnderTest.invokeCreateInstantiationRequest(DUMMY_GENERIC_VND_ID, CREATE_VNF_REQUEST);
+        assertFalse(actual.isPresent());
+
+    }
+
+
+    private void assertWithJobId(final String jobId) {
+        when(mockedHttpServiceProvider.postHttpRequest(eq(CREATE_VNF_REQUEST), anyString(),
+                eq(CreateVnfResponse.class))).thenReturn(mockedResponseEntity);
+        when(mockedResponseEntity.getStatusCode()).thenReturn(HttpStatus.ACCEPTED);
+        when(mockedResponseEntity.hasBody()).thenReturn(true);
+        final CreateVnfResponse response = getCreateVnfResponse(jobId);
+        when(mockedResponseEntity.getBody()).thenReturn(response);
+
+
+        final VnfmAdapterServiceProvider objUnderTest =
+                new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+
+        final Optional<CreateVnfResponse> actual =
+                objUnderTest.invokeCreateInstantiationRequest(DUMMY_GENERIC_VND_ID, CREATE_VNF_REQUEST);
+        assertFalse(actual.isPresent());
+    }
+
+    private void assertWithStatuCode(final HttpStatus status) {
+        when(mockedHttpServiceProvider.postHttpRequest(eq(CREATE_VNF_REQUEST), anyString(),
+                eq(CreateVnfResponse.class))).thenReturn(mockedResponseEntity);
+        when(mockedResponseEntity.getStatusCode()).thenReturn(status);
+        when(mockedResponseEntity.hasBody()).thenReturn(false);
+
+        final VnfmAdapterServiceProvider objUnderTest =
+                new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+
+        final Optional<CreateVnfResponse> actual =
+                objUnderTest.invokeCreateInstantiationRequest(DUMMY_GENERIC_VND_ID, CREATE_VNF_REQUEST);
+        assertFalse(actual.isPresent());
+    }
+
+
+
+    private CreateVnfResponse getCreateVnfResponse(final String jobId) {
+        final CreateVnfResponse response = new CreateVnfResponse();
+        response.setJobId(jobId);
+        return response;
+    }
+
+
+    private VnfmAdapterUrlProvider getVnfmAdapterUrlProvider() {
+        return new VnfmAdapterUrlProvider(getVnfmBasicHttpConfigProvider());
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProviderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProviderTest.java
new file mode 100644
index 0000000..cb93adc
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProviderTest.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.DUMMY_GENERIC_VND_ID;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.EXPECTED_URL;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getVnfmBasicHttpConfigProvider;
+
+import org.junit.Test;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterUrlProvider;
+
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class VnfmAdapterUrlProviderTest {
+
+
+    @Test
+    public void test_getCreateInstantiateUrl_returnValidCreationInstantiationRequest() {
+        final VnfmAdapterUrlProvider objUnderTest = new VnfmAdapterUrlProvider(getVnfmBasicHttpConfigProvider());
+
+        final String actual = objUnderTest.getCreateInstantiateUrl(DUMMY_GENERIC_VND_ID);
+
+        assertEquals(EXPECTED_URL, actual);
+    }
+
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
index be94a96..07983cc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
@@ -61,9 +61,9 @@
 
         doThrow(new BpmnError("BPMN Error")).when(exceptionUtil)
                 .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
-        when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID), any()))
+        when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID)))
                 .thenReturn(genericVnf);
-        when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID), any()))
+        when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
                 .thenReturn(serviceInstance);
     }
 
diff --git a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
index 14556f1..34ad6ef 100644
--- a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
+++ b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
@@ -20,7 +20,10 @@
 
 package org.onap.so.client;
 
+import org.onap.so.configuration.rest.HttpComponentsClientConfiguration;
 import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+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.http.client.BufferingClientHttpRequestFactory;
@@ -30,11 +33,28 @@
 @Configuration
 public class RestTemplateConfig {
 
-	@Bean
-	public RestTemplate restTemplate() {
-		RestTemplate restTemplate = new RestTemplate();		
-		restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
-		restTemplate.getInterceptors().add(new SpringClientFilter());
-		return restTemplate;
-	}
+    public static final String CONFIGURABLE_REST_TEMPLATE = "configurableRestTemplate";
+
+    @Autowired
+    private HttpComponentsClientConfiguration httpComponentsClientConfiguration;
+
+    @Bean
+    public RestTemplate restTemplate() {
+        final RestTemplate restTemplate = new RestTemplate();
+        restTemplate
+                .setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
+        restTemplate.getInterceptors().add(new SpringClientFilter());
+        return restTemplate;
+    }
+
+    @Bean
+    @Qualifier(CONFIGURABLE_REST_TEMPLATE)
+    public RestTemplate configurableRestTemplate() {
+        final HttpComponentsClientHttpRequestFactory clientHttpRequestFactory =
+                httpComponentsClientConfiguration.httpComponentsClientHttpRequestFactory();
+        final RestTemplate restTemplate =
+                new RestTemplate(new BufferingClientHttpRequestFactory(clientHttpRequestFactory));
+        restTemplate.getInterceptors().add(new SpringClientFilter());
+        return restTemplate;
+    }
 }
diff --git a/common/src/main/java/org/onap/so/configuration/rest/BasicHttpHeadersProvider.java b/common/src/main/java/org/onap/so/configuration/rest/BasicHttpHeadersProvider.java
new file mode 100644
index 0000000..7606f3a
--- /dev/null
+++ b/common/src/main/java/org/onap/so/configuration/rest/BasicHttpHeadersProvider.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.configuration.rest;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class BasicHttpHeadersProvider implements HttpHeadersProvider {
+
+    public static final String AUTHORIZATION_HEADER = "Authorization";
+
+    private final HttpHeaders headers = new HttpHeaders();
+
+    public BasicHttpHeadersProvider(final String authorization) {
+        headers.add(AUTHORIZATION_HEADER, authorization);
+        headers.setContentType(MediaType.APPLICATION_JSON);
+    }
+
+    public BasicHttpHeadersProvider() {
+        headers.setContentType(MediaType.APPLICATION_JSON);
+    }
+
+    @Override
+    public HttpHeaders getHttpHeaders() {
+        return headers;
+    }
+
+    @Override
+    public String toString() {
+        return "BasicHttpHeadersProvider [headers=" + headers + "]";
+    }
+
+}
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java b/common/src/main/java/org/onap/so/configuration/rest/HttpClientConnectionConfiguration.java
similarity index 76%
rename from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java
rename to common/src/main/java/org/onap/so/configuration/rest/HttpClientConnectionConfiguration.java
index 1260e53..a5a4cb7 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java
+++ b/common/src/main/java/org/onap/so/configuration/rest/HttpClientConnectionConfiguration.java
@@ -1,29 +1,36 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * 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.monitoring.configuration.rest;
+
+package org.onap.so.configuration.rest;
 
 import java.util.concurrent.TimeUnit;
 
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+/**
+ * This class is used configure the parameters needed for
+ * {@link org.apache.http.impl.client.CloseableHttpClient}
+ * 
+ * @author waqas.ikram@est.tech
+ */
 @Service
 public class HttpClientConnectionConfiguration {
 
@@ -43,45 +50,38 @@
     private int maxConnectionsPerRoute;
 
     /**
-     * @return the socketTimeOut
+     * @return the socket connection time out in milliseconds
      */
     public int getSocketTimeOutInMiliSeconds() {
         return (int) TimeUnit.SECONDS.toMillis(socketTimeOutInSeconds);
     }
 
     /**
-     * @return the maxConnections
+     * @return the maximum total connection value.
      */
     public int getMaxConnections() {
         return maxConnections;
     }
 
     /**
-     * @return the maxConnectionsPerRoute
+     * @return the maximum connection per route value.
      */
     public int getMaxConnectionsPerRoute() {
         return maxConnectionsPerRoute;
     }
 
     /**
-     * @return the connectionTimeOut
+     * @return the connect time out value in milliseconds.
      */
     public int getConnectionTimeOutInMilliSeconds() {
         return (int) TimeUnit.SECONDS.toMillis(connectionTimeOutInSeconds);
     }
 
     /**
-     * @return the timeToLive
+     * @return the connection time to live value in mintues.
      */
     public int getTimeToLiveInMins() {
         return (int) TimeUnit.SECONDS.toMinutes(timeToLiveInSeconds);
     }
 
-    @Override
-    public String toString() {
-        return "HttpClientConnectionConfiguration [connectionTimeOutInSeconds=" + connectionTimeOutInSeconds
-                + ", socketTimeOutInSeconds=" + socketTimeOutInSeconds + ", timeToLiveInSeconds=" + timeToLiveInSeconds
-                + ", maxConnections=" + maxConnections + ", maxConnectionsPerRoute=" + maxConnectionsPerRoute + "]";
-    }
-
 }
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java b/common/src/main/java/org/onap/so/configuration/rest/HttpComponentsClientConfiguration.java
similarity index 75%
rename from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java
rename to common/src/main/java/org/onap/so/configuration/rest/HttpComponentsClientConfiguration.java
index f8f0f68..e943aef 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java
+++ b/common/src/main/java/org/onap/so/configuration/rest/HttpComponentsClientConfiguration.java
@@ -17,8 +17,8 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
- 
-package org.onap.so.monitoring.configuration.rest;
+
+package org.onap.so.configuration.rest;
 
 import java.util.concurrent.TimeUnit;
 
@@ -27,35 +27,23 @@
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 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.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.web.client.RestTemplate;
 
 /**
- * @author waqas.ikram@ericsson.com
+ * Allow user to configure {@link org.apache.http.client.HttpClient}
+ * 
+ * @author waqas.ikram@est.tech
  */
 @Configuration
-public class RestTemplateConfiguration {
+public class HttpComponentsClientConfiguration {
 
-    public static final String DATABASE_REST_TEMPLATE = "databaseRestTemplate";
-
-    public static final String CAMUNDA_REST_TEMPLATE = "camundaRestTemplate";
+    private final HttpClientConnectionConfiguration clientConnectionConfiguration;
 
     @Autowired
-    private HttpClientConnectionConfiguration clientConnectionConfiguration;
-
-    @Bean
-    @Qualifier(CAMUNDA_REST_TEMPLATE)
-    public RestTemplate camundaRestTemplate() {
-        return new RestTemplate(httpComponentsClientHttpRequestFactory());
-    }
-
-    @Bean
-    @Qualifier(DATABASE_REST_TEMPLATE)
-    public RestTemplate dataBasecamundaRestTemplate() {
-        return new RestTemplate(httpComponentsClientHttpRequestFactory());
+    public HttpComponentsClientConfiguration(final HttpClientConnectionConfiguration clientConnectionConfiguration) {
+        this.clientConnectionConfiguration = clientConnectionConfiguration;
     }
 
     @Bean
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java b/common/src/main/java/org/onap/so/configuration/rest/HttpHeadersProvider.java
similarity index 67%
rename from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java
rename to common/src/main/java/org/onap/so/configuration/rest/HttpHeadersProvider.java
index 4606c04..0cff7b4 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java
+++ b/common/src/main/java/org/onap/so/configuration/rest/HttpHeadersProvider.java
@@ -1,33 +1,35 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * 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.monitoring.rest.service;
 
-import com.google.common.base.Optional;
+package org.onap.so.configuration.rest;
+
+import org.springframework.http.HttpHeaders;
 
 /**
- * @author waqas.ikram@ericsson.com
+ * Providers {@link org.springframework.http.HttpHeaders} for HTTP requests
+ * 
+ * @author waqas.ikram@est.tech
+ *
  */
-public interface HttpRestServiceProvider {
+public interface HttpHeadersProvider {
 
-    public <T> Optional<T> getHttpResponse(final String url, final Class<T> clazz);
-
-    public <T> Optional<T> postHttpRequest(final Object object, final String url, final Class<T> clazz);
+    HttpHeaders getHttpHeaders();
 
 }
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
index cecef19..ed63a70 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
@@ -57,6 +57,7 @@
     }
  
     private void processRequest(HttpRequest request, byte[] body) throws IOException {
+     setInvocationId();
     	setupHeaders(request);
     	setupMDC(request);
         if (log.isDebugEnabled()) {
@@ -89,7 +90,6 @@
         MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP, ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
         MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, clientRequest.getURI().toString());       
         MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
-        setInvocationId();
         MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY,extractTargetEntity(clientRequest));
     }
     
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java b/common/src/main/java/org/onap/so/rest/exceptions/InvalidRestRequestException.java
similarity index 89%
rename from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java
rename to common/src/main/java/org/onap/so/rest/exceptions/InvalidRestRequestException.java
index 4d3c489..2a97993 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java
+++ b/common/src/main/java/org/onap/so/rest/exceptions/InvalidRestRequestException.java
@@ -1,26 +1,27 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * 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.monitoring.exception;
+
+package org.onap.so.rest.exceptions;
 
 /**
- * @author waqas.ikram@ericsson.com
+ * @author waqas.ikram@est.tech
  *
  */
 public class InvalidRestRequestException extends RuntimeException {
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
similarity index 88%
rename from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java
rename to common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
index ab25854..e8ce00c 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java
+++ b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
@@ -1,26 +1,26 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 Ericsson. All rights reserved.
+ *  Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * 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.monitoring.exception;
+package org.onap.so.rest.exceptions;
 
 /**
- * @author waqas.ikram@ericsson.com
+ * @author waqas.ikram@est.tech
  *
  */
 public class RestProcessingException extends RuntimeException {
diff --git a/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProvider.java b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProvider.java
new file mode 100644
index 0000000..43b2fb4
--- /dev/null
+++ b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProvider.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.rest.service;
+
+import org.springframework.http.ResponseEntity;
+
+import com.google.common.base.Optional;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public interface HttpRestServiceProvider {
+
+    /**
+     * Execute the HTTP GET to the given URI template
+     * 
+     * @param url the URL
+     * @param clazz the type of the return value
+     * @return Returns the body of this entity.
+     */
+    public <T> Optional<T> get(final String url, final Class<T> clazz);
+
+    /**
+     * Execute the HTTP GET to the given URI template
+     * 
+     * @param url the URL
+     * @param clazz the type of the return value
+     * @return Returns the {@link ResponseEntity}.
+     */
+    public <T> ResponseEntity<T> getHttpResponse(final String url, final Class<T> clazz);
+
+
+    /**
+     * Execute the HTTP POST to the given URI template
+     * 
+     * @param object the entity (i.e. body) to write to the request
+     * @param url the URL
+     * @param clazz the type of the return value
+     * @return Returns the body of this entity.
+     */
+    public <T> Optional<T> post(final Object object, final String url, final Class<T> clazz);
+
+    /**
+     * Execute the HTTP POST to the given URI template
+     * 
+     * @param object the entity (i.e. body) to write to the request
+     * @param url the URL
+     * @param clazz the type of the return value
+     * @return Returns the {@link ResponseEntity}.
+     */
+    public <T> ResponseEntity<T> postHttpRequest(final Object object, final String url, final Class<T> clazz);
+
+
+}
diff --git a/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java
new file mode 100644
index 0000000..032df84
--- /dev/null
+++ b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.rest.service;
+
+import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
+import org.onap.so.configuration.rest.HttpHeadersProvider;
+import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+import com.google.common.base.Optional;
+
+/**
+ * A Service to perform HTTP requests
+ * 
+ * @author waqas.ikram@est.tech
+ */
+public class HttpRestServiceProviderImpl implements HttpRestServiceProvider {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HttpRestServiceProviderImpl.class);
+    private final RestTemplate restTemplate;
+    private final HttpHeadersProvider httpHeadersProvider;
+
+    public HttpRestServiceProviderImpl(final RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+        this.httpHeadersProvider = new BasicHttpHeadersProvider();
+    }
+
+    public HttpRestServiceProviderImpl(final RestTemplate restTemplate, final HttpHeadersProvider httpHeadersProvider) {
+        this.restTemplate = restTemplate;
+        this.httpHeadersProvider = httpHeadersProvider;
+    }
+
+    @Override
+    public <T> Optional<T> get(final String url, final Class<T> clazz) {
+        final ResponseEntity<T> response = getHttpResponse(url, clazz);
+        if (!response.getStatusCode().equals(HttpStatus.OK)) {
+            final String message =
+                    "Unable to invoke HTTP GET using URL: " + url + ", Response Code: " + response.getStatusCode();
+            LOGGER.error(message);
+            return Optional.absent();
+        }
+
+        if (response.hasBody()) {
+            return Optional.of(response.getBody());
+        }
+        return Optional.absent();
+    }
+
+
+    @Override
+    public <T> ResponseEntity<T> getHttpResponse(final String url, final Class<T> clazz) {
+        LOGGER.trace("Will invoke HTTP GET using URL: {}", url);
+        try {
+            final HttpEntity<?> request = new HttpEntity<>(getHttpHeaders());
+            return restTemplate.exchange(url, HttpMethod.GET, request, clazz);
+
+        } catch (final HttpClientErrorException httpClientErrorException) {
+            final String message = "Unable to invoke HTTP GET using url: " + url + ", Response: "
+                    + httpClientErrorException.getRawStatusCode();
+            LOGGER.error(message, httpClientErrorException);
+            final int rawStatusCode = httpClientErrorException.getRawStatusCode();
+            if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
+                throw new InvalidRestRequestException("No result found for given url: " + url);
+            }
+            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url);
+
+        } catch (final RestClientException restClientException) {
+            LOGGER.error("Unable to invoke HTTP GET using url: {}", url, restClientException);
+            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url, restClientException);
+        }
+    }
+
+    @Override
+    public <T> Optional<T> post(final Object object, final String url, final Class<T> clazz) {
+        final ResponseEntity<T> response = postHttpRequest(object, url, clazz);
+        if (!response.getStatusCode().equals(HttpStatus.OK)) {
+            final String message =
+                    "Unable to invoke HTTP GET using URL: " + url + ", Response Code: " + response.getStatusCode();
+            LOGGER.error(message);
+            return Optional.absent();
+        }
+
+        if (response.hasBody()) {
+            return Optional.of(response.getBody());
+        }
+
+        return Optional.absent();
+    }
+
+
+    @Override
+    public <T> ResponseEntity<T> postHttpRequest(final Object object, final String url, final Class<T> clazz) {
+        try {
+            final HttpEntity<?> request = new HttpEntity<>(object, getHttpHeaders());
+            return restTemplate.exchange(url, HttpMethod.POST, request, clazz);
+
+        } catch (final HttpClientErrorException httpClientErrorException) {
+            final String message = "Unable to invoke HTTP POST using url: " + url + ", Response: "
+                    + httpClientErrorException.getRawStatusCode();
+            LOGGER.error(message, httpClientErrorException);
+            final int rawStatusCode = httpClientErrorException.getRawStatusCode();
+            if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
+                throw new InvalidRestRequestException("No result found for given url: " + url);
+            }
+            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url);
+
+        } catch (final RestClientException restClientException) {
+            LOGGER.error("Unable to invoke HTTP POST using url: {}", url, restClientException);
+            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url, restClientException);
+        }
+    }
+
+    private HttpHeaders getHttpHeaders() {
+        return httpHeadersProvider.getHttpHeaders();
+    }
+}
diff --git a/common/src/test/java/org/onap/so/configuration/rest/BasicHttpHeadersProviderTest.java b/common/src/test/java/org/onap/so/configuration/rest/BasicHttpHeadersProviderTest.java
new file mode 100644
index 0000000..3e762cf
--- /dev/null
+++ b/common/src/test/java/org/onap/so/configuration/rest/BasicHttpHeadersProviderTest.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.configuration.rest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.onap.so.configuration.rest.BasicHttpHeadersProvider.AUTHORIZATION_HEADER;
+
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class BasicHttpHeadersProviderTest {
+
+    private static final String BASIC_AUTH_VALUE = "Basic AuthValue";
+
+    @Test
+    public void test_getHttpHeaders_ContentTypeIsJson() {
+        final HttpHeadersProvider objUnderTest = new BasicHttpHeadersProvider();
+        final HttpHeaders actualHttpHeaders = objUnderTest.getHttpHeaders();
+        assertNull(actualHttpHeaders.get(AUTHORIZATION_HEADER));
+        assertEquals(MediaType.APPLICATION_JSON, actualHttpHeaders.getContentType());
+    }
+
+    @Test
+    public void test_getHttpHeaders_ContainAuthorizationHeader() {
+        final HttpHeadersProvider objUnderTest = new BasicHttpHeadersProvider(BASIC_AUTH_VALUE);
+        final HttpHeaders actualHttpHeaders = objUnderTest.getHttpHeaders();
+        assertEquals(Arrays.asList(BASIC_AUTH_VALUE), actualHttpHeaders.get(AUTHORIZATION_HEADER));
+        assertEquals(MediaType.APPLICATION_JSON, actualHttpHeaders.getContentType());
+    }
+
+}
diff --git a/common/src/test/java/org/onap/so/configuration/rest/HttpComponentsClientConfigurationTest.java b/common/src/test/java/org/onap/so/configuration/rest/HttpComponentsClientConfigurationTest.java
new file mode 100644
index 0000000..5084acc
--- /dev/null
+++ b/common/src/test/java/org/onap/so/configuration/rest/HttpComponentsClientConfigurationTest.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.configuration.rest;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class HttpComponentsClientConfigurationTest {
+
+    @Test
+    public void test_httpComponentsClientHttpRequestFactory_HttpComponentsClientHttpRequestFactoryNotNull() {
+        final HttpClientConnectionConfiguration clientConnectionConfiguration = new HttpClientConnectionConfiguration();
+        final HttpComponentsClientConfiguration objUnderTest =
+                new HttpComponentsClientConfiguration(clientConnectionConfiguration);
+
+        final HttpComponentsClientHttpRequestFactory factory = objUnderTest.httpComponentsClientHttpRequestFactory();
+        assertNotNull(factory);
+        assertNotNull(factory.getHttpClient());
+
+    }
+
+}
diff --git a/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java b/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java
new file mode 100644
index 0000000..a738afe
--- /dev/null
+++ b/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java
@@ -0,0 +1,252 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.rest.service;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+import com.google.common.base.Optional;
+
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class HttpRestServiceProviderImplTest {
+
+    private static final String BODY = "{}";
+    private static final String DUMMY_URL = "http://localhost:9000/dummy/url";
+
+    @Mock
+    private RestTemplate mockRestTemplate;
+
+    @Mock
+    private ResponseEntity<String> mockEntity;
+
+    @Test
+    public void test_get_returnOptionalPresentIfResponseIsOKAndHasBody() {
+
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.OK);
+        when(mockEntity.hasBody()).thenReturn(true);
+        when(mockEntity.getBody()).thenReturn(BODY);
+
+        final Optional<String> actual = objUnderTest.get(DUMMY_URL, String.class);
+
+        assertTrue(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class),
+                eq(String.class));
+    }
+
+    @Test
+    public void test_get_returnOptionalPresentIfResponseIsNotOK() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR);
+
+        final Optional<String> actual = objUnderTest.get(DUMMY_URL, String.class);
+
+        assertFalse(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class),
+                eq(String.class));
+    }
+
+    @Test
+    public void test_get_returnOptionalPresentIfResponseIsOKAndNoBody() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.OK);
+        when(mockEntity.hasBody()).thenReturn(false);
+
+        final Optional<String> actual = objUnderTest.get(DUMMY_URL, String.class);
+
+        assertFalse(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class),
+                eq(String.class));
+    }
+
+    @Test(expected = InvalidRestRequestException.class)
+    public void test_get_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusBadRequest() {
+        assertGetErrorScenario(HttpStatus.BAD_REQUEST);
+
+    }
+
+    @Test(expected = InvalidRestRequestException.class)
+    public void test_get_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusNotFoundHttpStatus() {
+        assertGetErrorScenario(HttpStatus.NOT_FOUND);
+    }
+
+    @Test(expected = RestProcessingException.class)
+    public void test_get_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionOccured() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(HttpClientErrorException.class);
+
+        objUnderTest.get(DUMMY_URL, String.class);
+    }
+
+    @Test(expected = RestProcessingException.class)
+    public void test_get_ThrowsInvalidRestRequestExceptionifRestProcessingExceptionOccured() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(RestClientException.class);
+
+        objUnderTest.get(DUMMY_URL, String.class);
+    }
+
+    @Test
+    public void test_post_returnOptionalPresentIfResponseIsOKAndHasBody() {
+
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.OK);
+        when(mockEntity.hasBody()).thenReturn(true);
+        when(mockEntity.getBody()).thenReturn(BODY);
+
+        final Optional<String> actual = objUnderTest.post(BODY, DUMMY_URL, String.class);
+
+        assertTrue(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class),
+                eq(String.class));
+    }
+
+    @Test
+    public void test_post_returnOptionalPresentIfResponseIsOKAndHasNoBody() {
+
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.OK);
+        when(mockEntity.hasBody()).thenReturn(false);
+
+        final Optional<String> actual = objUnderTest.post(BODY, DUMMY_URL, String.class);
+
+        assertFalse(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class),
+                eq(String.class));
+    }
+
+
+    @Test
+    public void test_post_returnOptionalPresentIfResponseIsNotOKAndHasBody() {
+
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenReturn(mockEntity);
+
+        when(mockEntity.getStatusCode()).thenReturn(HttpStatus.PARTIAL_CONTENT);
+
+        final Optional<String> actual = objUnderTest.post(BODY, DUMMY_URL, String.class);
+
+        assertFalse(actual.isPresent());
+        verify(mockRestTemplate, atLeastOnce()).exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class),
+                eq(String.class));
+    }
+    
+    @Test(expected = InvalidRestRequestException.class)
+    public void test_post_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusBadRequest() {
+        assertPostErrorScenario(HttpStatus.BAD_REQUEST);
+
+    }
+
+    @Test(expected = InvalidRestRequestException.class)
+    public void test_post_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusNotFoundHttpStatus() {
+        assertPostErrorScenario(HttpStatus.NOT_FOUND);
+    }
+    
+    @Test(expected = RestProcessingException.class)
+    public void test_post_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionOccured() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(HttpClientErrorException.class);
+
+        objUnderTest.post(BODY, DUMMY_URL, String.class);
+    }
+
+    @Test(expected = RestProcessingException.class)
+    public void test_post_ThrowsInvalidRestRequestExceptionifRestProcessingExceptionOccured() {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(RestClientException.class);
+
+        objUnderTest.post(BODY, DUMMY_URL, String.class);
+    }
+
+    private void assertPostErrorScenario(final HttpStatus status) {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        final HttpClientErrorException errorException = new HttpClientErrorException(status);
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(errorException);
+
+        objUnderTest.post(BODY, DUMMY_URL, String.class);
+    }
+
+    private void assertGetErrorScenario(final HttpStatus status) {
+        final HttpRestServiceProvider objUnderTest = new HttpRestServiceProviderImpl(mockRestTemplate);
+
+        final HttpClientErrorException errorException = new HttpClientErrorException(status);
+        when(mockRestTemplate.exchange(eq(DUMMY_URL), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
+                .thenThrow(errorException);
+
+        objUnderTest.get(DUMMY_URL, String.class);
+    }
+
+}
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java
deleted file mode 100644
index 34afd82..0000000
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 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.monitoring.configuration.rest;
-
-import java.io.IOException;
-
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpRequest;
-import org.springframework.http.client.ClientHttpRequestExecution;
-import org.springframework.http.client.ClientHttpRequestInterceptor;
-import org.springframework.http.client.ClientHttpResponse;
-
-/**
- * @author waqas.ikram@ericsson.com
- *
- */
-public class BasicAuthorizationHttpRequestInterceptor implements ClientHttpRequestInterceptor {
-
-    private final String authorization;
-
-    public BasicAuthorizationHttpRequestInterceptor(final String authorization) {
-        this.authorization = authorization;
-    }
-
-    @Override
-    public ClientHttpResponse intercept(final HttpRequest request, final byte[] body,
-            final ClientHttpRequestExecution execution) throws IOException {
-        final HttpHeaders headers = request.getHeaders();
-        headers.add("Authorization", authorization);
-        return execution.execute(request, body);
-    }
-}
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java
index a590d79..11c4d1b 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java
+++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java
@@ -19,17 +19,17 @@
  */
 package org.onap.so.monitoring.configuration.rest;
 
-import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE;
-import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.DATABASE_REST_TEMPLATE;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
 
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProviderImpl;
+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.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.http.client.ClientHttpRequestInterceptor;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -45,28 +45,22 @@
     @Bean
     @Qualifier(CAMUNDA_HTTP_REST_SERVICE_PROVIDER)
     public HttpRestServiceProvider camundaHttpRestServiceProvider(
-            @Qualifier(CAMUNDA_REST_TEMPLATE) @Autowired final RestTemplate restTemplate,
+            @Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate,
             @Value(value = "${camunda.rest.api.auth:#{null}}") final String authorization) {
-        return getHttpRestServiceProvider(restTemplate, authorization);
+        return getHttpRestServiceProvider(restTemplate, new BasicHttpHeadersProvider(authorization));
     }
 
     @Bean
     @Qualifier(DATABASE_HTTP_REST_SERVICE_PROVIDER)
     public HttpRestServiceProvider databaseHttpRestServiceProvider(
-            @Qualifier(DATABASE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate,
+            @Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate,
             @Value(value = "${mso.database.rest.api.auth:#{null}}") final String authorization) {
-
-        return getHttpRestServiceProvider(restTemplate, authorization);
+        return getHttpRestServiceProvider(restTemplate, new BasicHttpHeadersProvider(authorization));
     }
 
     private HttpRestServiceProvider getHttpRestServiceProvider(final RestTemplate restTemplate,
-            final String authorization) {
-        if (authorization != null && !authorization.isEmpty()) {
-            final ClientHttpRequestInterceptor authorizationInterceptor =
-                    new BasicAuthorizationHttpRequestInterceptor(authorization);
-            restTemplate.getInterceptors().add(authorizationInterceptor);
-        }
-        return new HttpRestServiceProviderImpl(restTemplate);
+            final HttpHeadersProvider httpHeadersProvider) {
+        return new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
     }
 
 
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java
index 6be6367..49e3d4f 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java
+++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java
@@ -30,7 +30,7 @@
 import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider;
 import org.onap.so.monitoring.model.SoInfraRequest;
 import org.onap.so.monitoring.model.SoInfraRequestBuilder;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
@@ -60,7 +60,7 @@
         final String url = urlProvider.getSearchUrl(startTime, endTime, maxResult);
 
         final Optional<SoActiveInfraRequests[]> optionalRequests =
-                httpRestServiceProvider.postHttpRequest(filters, url, SoActiveInfraRequests[].class);
+                httpRestServiceProvider.post(filters, url, SoActiveInfraRequests[].class);
         if (optionalRequests.isPresent()) {
             return getSoInfraRequest(optionalRequests.get());
         }
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java
index e6fbb68..b7a439f 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java
+++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java
@@ -35,15 +35,15 @@
 import org.onap.so.monitoring.model.ProcessInstanceDetail;
 import org.onap.so.monitoring.model.ProcessInstanceIdDetail;
 import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+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.stereotype.Service;
 
 import com.google.common.base.Optional;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * @author waqas.ikram@ericsson.com
  */
@@ -64,13 +64,12 @@
     @Override
     public Optional<ProcessInstanceIdDetail> getProcessInstanceIdDetail(final String requestId) {
         final String url = urlProvider.getHistoryProcessInstanceUrl(requestId);
-        final Optional<ProcessInstance[]> processInstances =
-                httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class);
+        final Optional<ProcessInstance[]> processInstances = httpRestServiceProvider.get(url, ProcessInstance[].class);
 
         if (processInstances.isPresent()) {
             final ProcessInstance[] instances = processInstances.get();
-            final String message = "found process instance for request id: " + requestId + 
-                ", result size: " + instances.length;
+            final String message =
+                    "found process instance for request id: " + requestId + ", result size: " + instances.length;
             LOGGER.debug(message);
 
             if (instances.length > 0) {
@@ -79,8 +78,8 @@
                     if (processInstance.getSuperProcessInstanceId() == null) {
                         return Optional.of(new ProcessInstanceIdDetail(processInstance.getId()));
                     }
-                    LOGGER.debug("found sub process instance id with super process instanceId: " +
-                            processInstance.getSuperProcessInstanceId());
+                    LOGGER.debug("found sub process instance id with super process instanceId: "
+                            + processInstance.getSuperProcessInstanceId());
                 }
             }
         }
@@ -91,8 +90,7 @@
     @Override
     public Optional<ProcessInstanceDetail> getSingleProcessInstanceDetail(final String processInstanceId) {
         final String url = urlProvider.getSingleProcessInstanceUrl(processInstanceId);
-        final Optional<ProcessInstance> processInstances =
-                httpRestServiceProvider.getHttpResponse(url, ProcessInstance.class);
+        final Optional<ProcessInstance> processInstances = httpRestServiceProvider.get(url, ProcessInstance.class);
 
         if (processInstances.isPresent()) {
             final ProcessInstance processInstance = processInstances.get();
@@ -111,8 +109,7 @@
     @Override
     public Optional<ProcessDefinitionDetail> getProcessDefinition(final String processDefinitionId) {
         final String url = urlProvider.getProcessDefinitionUrl(processDefinitionId);
-        final Optional<ProcessDefinition> response =
-                httpRestServiceProvider.getHttpResponse(url, ProcessDefinition.class);
+        final Optional<ProcessDefinition> response = httpRestServiceProvider.get(url, ProcessDefinition.class);
         if (response.isPresent()) {
             final ProcessDefinition processDefinition = response.get();
             final String xmlDefinition = processDefinition.getBpmn20Xml();
@@ -120,16 +117,14 @@
                 return Optional.of(new ProcessDefinitionDetail(processDefinitionId, xmlDefinition));
             }
         }
-        LOGGER.error("Unable to find process definition for processDefinitionId: " + 
-                     processDefinitionId);
+        LOGGER.error("Unable to find process definition for processDefinitionId: " + processDefinitionId);
         return Optional.absent();
     }
 
     @Override
     public List<ActivityInstanceDetail> getActivityInstance(final String processInstanceId) {
         final String url = urlProvider.getActivityInstanceUrl(processInstanceId);
-        final Optional<ActivityInstance[]> response =
-                httpRestServiceProvider.getHttpResponse(url, ActivityInstance[].class);
+        final Optional<ActivityInstance[]> response = httpRestServiceProvider.get(url, ActivityInstance[].class);
         if (response.isPresent()) {
             final ActivityInstance[] activityInstances = response.get();
             final List<ActivityInstanceDetail> activityInstanceDetails = new ArrayList<>(activityInstances.length);
@@ -148,8 +143,7 @@
             }
             return activityInstanceDetails;
         }
-        LOGGER.error("Unable to find activity intance detail for process instance id: " + 
-                     processInstanceId);
+        LOGGER.error("Unable to find activity intance detail for process instance id: " + processInstanceId);
         return Collections.emptyList();
     }
 
@@ -157,7 +151,7 @@
     public List<ProcessInstanceVariableDetail> getProcessInstanceVariable(final String processInstanceId) {
         final String url = urlProvider.getProcessInstanceVariablesUrl(processInstanceId);
         final Optional<ProcessInstanceVariable[]> response =
-                httpRestServiceProvider.getHttpResponse(url, ProcessInstanceVariable[].class);
+                httpRestServiceProvider.get(url, ProcessInstanceVariable[].class);
         if (response.isPresent()) {
             final ProcessInstanceVariable[] instanceVariables = response.get();
             final List<ProcessInstanceVariableDetail> instanceVariableDetails =
@@ -171,8 +165,7 @@
             }
             return instanceVariableDetails;
         }
-        LOGGER.error("Unable to find process intance variable details for process instance id: " 
-                     + processInstanceId);
+        LOGGER.error("Unable to find process intance variable details for process instance id: " + processInstanceId);
         return Collections.emptyList();
     }
 
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java
deleted file mode 100644
index 82a54c1..0000000
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2018 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.monitoring.rest.service;
-
-import org.onap.so.monitoring.exception.InvalidRestRequestException;
-import org.onap.so.monitoring.exception.RestProcessingException;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-
-import com.google.common.base.Optional;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author waqas.ikram@ericsson.com
- */
-public class HttpRestServiceProviderImpl implements HttpRestServiceProvider {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(HttpRestServiceProviderImpl.class);
-    private final RestTemplate restTemplate;
-
-    public HttpRestServiceProviderImpl(final RestTemplate restTemplate) {
-        this.restTemplate = restTemplate;
-    }
-
-    @Override
-    public <T> Optional<T> getHttpResponse(final String url, final Class<T> clazz) {
-        LOGGER.trace("Will invoke HTTP GET using URL: " + url);
-        try {
-            final ResponseEntity<T> response = restTemplate.exchange(url, HttpMethod.GET, null, clazz);
-            if (!response.getStatusCode().equals(HttpStatus.OK)) {
-                final String message = "Unable to invoke HTTP GET using URL: " + url + 
-                    ", Response Code: " + response.getStatusCode();
-                LOGGER.error(message);
-                return Optional.absent();
-            }
-
-            if (response.hasBody()) {
-                return Optional.of(response.getBody());
-            }
-        } catch (final HttpClientErrorException httpClientErrorException) {
-            final String message = "Unable to invoke HTTP GET using url: " + url + ", Response: " +
-                    httpClientErrorException.getRawStatusCode();
-            LOGGER.error(message, httpClientErrorException);
-            final int rawStatusCode = httpClientErrorException.getRawStatusCode();
-            if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
-                throw new InvalidRestRequestException("No result found for given url: " + url);
-            }
-            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + url);
-
-        } catch (final RestClientException restClientException) {
-            LOGGER.error("Unable to invoke HTTP GET using url: " + url, restClientException);
-            throw new RestProcessingException("Unable to invoke HTTP GET using URL: " + 
-                                              url, restClientException);
-        }
-
-        return Optional.absent();
-    }
-
-    @Override
-    public <T> Optional<T> postHttpRequest(final Object object, final String url, final Class<T> clazz) {
-        try {
-            final HttpEntity<?> request = new HttpEntity<>(object);
-            final ResponseEntity<T> response = restTemplate.exchange(url, HttpMethod.POST, request, clazz);
-            if (!response.getStatusCode().equals(HttpStatus.OK)) {
-                final String message = "Unable to invoke HTTP GET using URL: " + url + 
-                    ", Response Code: " + response.getStatusCode();
-                LOGGER.error(message);
-                return Optional.absent();
-            }
-
-            if (response.hasBody()) {
-                return Optional.of(response.getBody());
-            }
-
-        } catch (final HttpClientErrorException httpClientErrorException) {
-            final String message = "Unable to invoke HTTP POST using url: " + url + 
-                ", Response: " + httpClientErrorException.getRawStatusCode();
-            LOGGER.error(message, httpClientErrorException);
-            final int rawStatusCode = httpClientErrorException.getRawStatusCode();
-            if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
-                throw new InvalidRestRequestException("No result found for given url: " + url);
-            }
-            throw new RestProcessingException("Unable to invoke HTTP POST using URL: " + url);
-
-        } catch (final RestClientException restClientException) {
-            LOGGER.error("Unable to invoke HTTP POST using url: " + url, restClientException);
-            throw new RestProcessingException("Unable to invoke HTTP POST using URL: " 
-                                              + url, restClientException);
-        }
-
-        return Optional.absent();
-    }
-
-
-}
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
index 1b3e168..9df24c1 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
@@ -23,7 +23,7 @@
 
 import org.junit.Test;
 import org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
 import org.springframework.web.client.RestTemplate;
 
 /**
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
index 5866667..3a7ce18 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
@@ -38,7 +38,7 @@
 import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
 import org.onap.so.monitoring.db.service.DatabaseServiceProviderImpl;
 import org.onap.so.monitoring.model.SoInfraRequest;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
 
 import com.google.common.base.Optional;
 
@@ -57,8 +57,8 @@
         final String searchUrl = URL_PROVIDER.getSearchUrl(0, 0, null);
         final Optional<SoActiveInfraRequests[]> response = Optional.of(new SoActiveInfraRequests[] {});
 
-        when(mockServiceProvider.postHttpRequest(eq(Collections.emptyMap()), eq(searchUrl),
-                eq(SoActiveInfraRequests[].class))).thenReturn(response);
+        when(mockServiceProvider.post(eq(Collections.emptyMap()), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+                .thenReturn(response);
 
         final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
 
@@ -71,8 +71,8 @@
         final String searchUrl = URL_PROVIDER.getSearchUrl(0, 0, null);
         final Optional<SoActiveInfraRequests[]> response = Optional.absent();
 
-        when(mockServiceProvider.postHttpRequest(eq(Collections.emptyMap()), eq(searchUrl),
-                eq(SoActiveInfraRequests[].class))).thenReturn(response);
+        when(mockServiceProvider.post(eq(Collections.emptyMap()), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+                .thenReturn(response);
 
         final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
 
@@ -94,7 +94,7 @@
 
         final HttpRestServiceProvider mockServiceProvider = mock(HttpRestServiceProvider.class);
 
-        when(mockServiceProvider.postHttpRequest(eq(filters), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+        when(mockServiceProvider.post(eq(filters), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
                 .thenReturn(response);
 
         final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
index c3930df..d21cf6d 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
@@ -38,6 +38,7 @@
 import org.onap.so.monitoring.model.ProcessDefinitionDetail;
 import org.onap.so.monitoring.model.ProcessInstanceIdDetail;
 import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.rest.service.HttpRestServiceProvider;
 
 import com.google.common.base.Optional;
 
@@ -65,7 +66,7 @@
     public void test_GetProcessInstanceDetail_EmptyResponse() {
         final Optional<ProcessInstance[]> response = Optional.<ProcessInstance[]>absent();
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -77,7 +78,7 @@
     public void test_GetProcessInstanceDetail_NonEmptyResponseWithSuperProcessIdNull() {
         final Optional<ProcessInstance[]> response = Optional.of(getProcessInstance());
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -92,7 +93,7 @@
     public void test_GetProcessInstanceDetail_NonEmptyResponseWithSuperProcessIdNotNull() {
         final Optional<ProcessInstance[]> response = Optional.of(getProcessInstance(SUPER_PROCESS_ID));
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -105,7 +106,7 @@
     public void test_GetProcessDefinition_EmptyResponse() {
         final Optional<ProcessDefinition> response = Optional.<ProcessDefinition>absent();
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/process-definition/" + ID + "/xml";
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessDefinition.class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessDefinition.class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -117,7 +118,7 @@
     public void test_GetProcessDefinition_NonEmptyResponse() {
         final Optional<ProcessDefinition> response = getProcessDefinition();
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/process-definition/" + PROCESS_ID + "/xml";
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessDefinition.class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessDefinition.class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -132,7 +133,7 @@
         final Optional<ActivityInstance[]> response = Optional.<ActivityInstance[]>absent();
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/activity-instance?processInstanceId=" + PROCESS_ID
                 + "&sortBy=startTime&sortOrder=asc";
-        when(httpRestServiceProvider.getHttpResponse(url, ActivityInstance[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ActivityInstance[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -146,7 +147,7 @@
         final Optional<ActivityInstance[]> response = getActivityInstance();
         final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/activity-instance?processInstanceId=" + PROCESS_ID
                 + "&sortBy=startTime&sortOrder=asc";
-        when(httpRestServiceProvider.getHttpResponse(url, ActivityInstance[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ActivityInstance[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -164,7 +165,7 @@
         final Optional<ProcessInstanceVariable[]> response = Optional.<ProcessInstanceVariable[]>absent();
         final String url =
                 CAMUNDA_REST_API_URL + DEFAULT + "/history/variable-instance?processInstanceId=" + PROCESS_ID;
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessInstanceVariable[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessInstanceVariable[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
@@ -178,7 +179,7 @@
         final Optional<ProcessInstanceVariable[]> response = getProcessInstanceVariable();
         final String url =
                 CAMUNDA_REST_API_URL + DEFAULT + "/history/variable-instance?processInstanceId=" + PROCESS_ID;
-        when(httpRestServiceProvider.getHttpResponse(url, ProcessInstanceVariable[].class)).thenReturn(response);
+        when(httpRestServiceProvider.get(url, ProcessInstanceVariable[].class)).thenReturn(response);
         final CamundaProcessDataServiceProvider objUnderTest =
                 new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
 
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
index 155b4e6..d2fa08f 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
@@ -33,8 +33,6 @@
 import javax.ws.rs.core.Response.Status;
 
 import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
-import org.onap.so.monitoring.exception.InvalidRestRequestException;
-import org.onap.so.monitoring.exception.RestProcessingException;
 import org.onap.so.monitoring.model.ActivityInstanceDetail;
 import org.onap.so.monitoring.model.ProcessDefinitionDetail;
 import org.onap.so.monitoring.model.ProcessInstanceDetail;
@@ -42,14 +40,15 @@
 import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
 import org.onap.so.monitoring.model.SoInfraRequest;
 import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider;
+import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.google.common.base.Optional;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * @author waqas.ikram@ericsson.com
  */
@@ -134,8 +133,7 @@
     @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
     public Response getProcessDefinitionXml(final @PathParam("processDefinitionId") String processDefinitionId) {
         if (processDefinitionId == null || processDefinitionId.isEmpty()) {
-            return Response.status(Status.BAD_REQUEST).entity("Invalid process definition id: " + 
-                                                              processDefinitionId)
+            return Response.status(Status.BAD_REQUEST).entity("Invalid process definition id: " + processDefinitionId)
                     .build();
         }
         try {
@@ -145,18 +143,15 @@
                 final ProcessDefinitionDetail definitionDetail = response.get();
                 return Response.status(Status.OK).entity(definitionDetail).build();
             }
-            LOGGER.error("Unable to find process definition xml for processDefinitionId: " + 
-                         processDefinitionId);
+            LOGGER.error("Unable to find process definition xml for processDefinitionId: " + processDefinitionId);
             return Response.status(Status.NO_CONTENT).build();
 
         } catch (final InvalidRestRequestException extensions) {
             final String message =
-                    "Unable to find process definition xml for processDefinitionId: {}" + 
-                processDefinitionId;
+                    "Unable to find process definition xml for processDefinitionId: {}" + processDefinitionId;
             return Response.status(Status.BAD_REQUEST).entity(message).build();
         } catch (final RestProcessingException restProcessingException) {
-            final String message = "Unable to get process definition xml for id: " + 
-                processDefinitionId;
+            final String message = "Unable to get process definition xml for id: " + processDefinitionId;
             LOGGER.error(message);
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
         }
@@ -175,13 +170,11 @@
                     camundaProcessDataServiceProvider.getActivityInstance(processInstanceId);
             return Response.status(Status.OK).entity(activityInstanceDetails).build();
         } catch (final InvalidRestRequestException extensions) {
-            final String message = "Unable to find activity instance for processInstanceId: " + 
-                processInstanceId;
+            final String message = "Unable to find activity instance for processInstanceId: " + processInstanceId;
             LOGGER.error(message);
             return Response.status(Status.BAD_REQUEST).entity(message).build();
         } catch (final RestProcessingException restProcessingException) {
-            final String message = "Unable to get activity instance detail for id: " + 
-                processInstanceId;
+            final String message = "Unable to get activity instance detail for id: " + processInstanceId;
             LOGGER.error(message);
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
         }
@@ -201,13 +194,11 @@
             return Response.status(Status.OK).entity(processInstanceVariable).build();
         } catch (final InvalidRestRequestException extensions) {
             final String message =
-                    "Unable to find process instance variables for processInstanceId: " + 
-                processInstanceId;
+                    "Unable to find process instance variables for processInstanceId: " + processInstanceId;
             LOGGER.error(message);
             return Response.status(Status.BAD_REQUEST).entity(message).build();
         } catch (final RestProcessingException restProcessingException) {
-            final String message = "Unable to get process instance variables for id: " + 
-                processInstanceId;
+            final String message = "Unable to get process instance variables for id: " + processInstanceId;
             LOGGER.error(message);
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
         }
@@ -230,13 +221,13 @@
             return Response.status(Status.OK).entity(requests).build();
 
         } catch (final InvalidRestRequestException extensions) {
-            final String message = "Unable to search request for filters: " + filters + ", from: " + 
-                startTime + ", to: " + endTime + ", maxResult: " + maxResult;
+            final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
+                    + ", to: " + endTime + ", maxResult: " + maxResult;
             LOGGER.error(message);
             return Response.status(Status.BAD_REQUEST).entity(message).build();
         } catch (final RestProcessingException restProcessingException) {
-            final String message = "Unable to search request for filters: " + filters + ", from: " + 
-                startTime + ", to: " + endTime + ", maxResult: " + maxResult;
+            final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
+                    + ", to: " + endTime + ", maxResult: " + maxResult;
             LOGGER.error(message);
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
         }
diff --git a/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java b/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java
index 3ca184e..2c4d036 100644
--- a/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java
+++ b/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java
@@ -22,8 +22,8 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE;
-import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.DATABASE_REST_TEMPLATE;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.onap.so.configuration.rest.BasicHttpHeadersProvider.AUTHORIZATION_HEADER;
 import static org.onap.so.monitoring.rest.api.Constants.ACTIVITY_INSTANCE_RESPONSE_JSON_FILE;
 import static org.onap.so.monitoring.rest.api.Constants.EMPTY_ARRAY_RESPONSE;
 import static org.onap.so.monitoring.rest.api.Constants.EMPTY_STRING;
@@ -37,6 +37,7 @@
 import static org.onap.so.monitoring.rest.api.Constants.SEARCH_RESULT_RESPONSE_JSON_FILE;
 import static org.onap.so.monitoring.rest.api.Constants.SINGLE_PROCCESS_INSTANCE_RESPONSE_JSON_FILE;
 import static org.onap.so.monitoring.rest.api.Constants.START_TIME_IN_MS;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.header;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
@@ -81,38 +82,37 @@
 @ActiveProfiles("test")
 @SpringBootTest
 public class SoMonitoringControllerTest {
+    private static final String CAMUNDA_BASIC_AUTH =
+            "Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==";
+
+    private static final String DATABASE_BASIC_AUTH = "Basic YnBlbDpwYXNzd29yZDEk";
 
     @Autowired
-    @Qualifier(CAMUNDA_REST_TEMPLATE)
+    @Qualifier(CONFIGURABLE_REST_TEMPLATE)
     private RestTemplate restTemplate;
 
     @Autowired
-    @Qualifier(DATABASE_REST_TEMPLATE)
-    private RestTemplate dataBaseRestTemplate;
-
-    @Autowired
     private CamundaRestUrlProvider urlProvider;
 
     @Autowired
     private DatabaseUrlProvider databaseUrlProvider;
 
-    private MockRestServiceServer camundaMockServer;
+    private MockRestServiceServer mockRestServiceServer;
 
-    private MockRestServiceServer databaseMockServer;
 
     @Autowired
     private SoMonitoringController objUnderTest;
 
     @Before
     public void setUp() throws Exception {
-        camundaMockServer = MockRestServiceServer.bindTo(restTemplate).build();
-        databaseMockServer = MockRestServiceServer.bindTo(dataBaseRestTemplate).build();
+        mockRestServiceServer = MockRestServiceServer.bindTo(restTemplate).build();
     }
 
     @Test
     public void test_GetProcessInstance_SuccessResponseWithDataFromCamunda() throws Exception {
         final String jsonString = getJsonResponse(PROCCESS_INSTANCE_RESPONSE_JSON_FILE);
-        this.camundaMockServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
+                .andExpect(header(AUTHORIZATION_HEADER, CAMUNDA_BASIC_AUTH))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getProcessInstanceId(ID);
@@ -125,7 +125,7 @@
     @Test
     public void test_GetProcessInstance_SuccessResponseWithEmptyDataFromCamunda() throws Exception {
         final String jsonString = EMPTY_ARRAY_RESPONSE;
-        this.camundaMockServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getProcessInstanceId(ID);
@@ -135,7 +135,7 @@
 
     @Test
     public void test_GetProcessInstance_FailureResponseWithEmptyDataFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
                 .andRespond(withBadRequest());
 
         final Response response = objUnderTest.getProcessInstanceId(ID);
@@ -144,7 +144,7 @@
 
     @Test
     public void test_GetProcessInstance_UnauthorizedRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getHistoryProcessInstanceUrl(ID)))
                 .andRespond(withUnauthorizedRequest());
 
         final Response response = objUnderTest.getProcessInstanceId(ID);
@@ -155,7 +155,7 @@
     @Test
     public void test_GetSinlgeProcessInstance_SuccessResponseWithDataFromCamunda() throws Exception {
         final String jsonString = getJsonResponse(SINGLE_PROCCESS_INSTANCE_RESPONSE_JSON_FILE);
-        this.camundaMockServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getSingleProcessInstance(PROCESS_INSTACE_ID);
@@ -171,7 +171,7 @@
 
     @Test
     public void test_GetSingleProcessInstance_WithBadRequestResponseFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withBadRequest());
 
         final Response response = objUnderTest.getSingleProcessInstance(PROCESS_INSTACE_ID);
@@ -181,7 +181,7 @@
 
     @Test
     public void test_GetSingleProcessInstance_WithUnauthorizedRequestResponseFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getSingleProcessInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withUnauthorizedRequest());
 
         final Response response = objUnderTest.getSingleProcessInstance(PROCESS_INSTACE_ID);
@@ -216,7 +216,7 @@
     @Test
     public void test_GetProcessDefinitionXml_SuccessResponseWithDataFromCamunda() throws Exception {
         final String jsonString = getJsonResponse(PROCESS_DEF_RESPONSE_JSON_FILE);
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getProcessDefinitionXml(PROCRESS_DEF_ID);
@@ -228,7 +228,7 @@
 
     @Test
     public void test_GetProcessDefinitionXml_BadRequestResponseFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
                 .andRespond(withBadRequest());
 
         final Response response = objUnderTest.getProcessDefinitionXml(PROCRESS_DEF_ID);
@@ -238,7 +238,7 @@
 
     @Test
     public void test_GetProcessDefinitionXml_UnauthorizedRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessDefinitionUrl(PROCRESS_DEF_ID)))
                 .andRespond(withUnauthorizedRequest());
 
         final Response response = objUnderTest.getProcessDefinitionXml(PROCRESS_DEF_ID);
@@ -260,7 +260,7 @@
     @Test
     public void test_GetActivityInstanceDetail_SuccessResponseWithDataFromCamunda() throws Exception {
         final String jsonString = getJsonResponse(ACTIVITY_INSTANCE_RESPONSE_JSON_FILE);
-        this.camundaMockServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getActivityInstanceDetail(PROCESS_INSTACE_ID);
@@ -287,7 +287,7 @@
 
     @Test
     public void test_GetActivityInstanceDetail_SuccessResponseWithEmptyDataFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withSuccess(EMPTY_ARRAY_RESPONSE, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getActivityInstanceDetail(PROCESS_INSTACE_ID);
@@ -297,7 +297,7 @@
 
     @Test
     public void test_GetActivityInstanceDetail_UnauthorizedRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withUnauthorizedRequest());
 
         final Response response = objUnderTest.getActivityInstanceDetail(PROCESS_INSTACE_ID);
@@ -307,7 +307,7 @@
 
     @Test
     public void test_GetActivityInstanceDetail_BadRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getActivityInstanceUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withBadRequest());
 
         final Response response = objUnderTest.getActivityInstanceDetail(PROCESS_INSTACE_ID);
@@ -329,7 +329,7 @@
     @Test
     public void test_GetProcessInstanceVariables_SuccessResponseWithDataFromCamunda() throws Exception {
         final String jsonString = getJsonResponse(PROCESS_INSTANCE_VARIABLES_RESPONSE_JSON_FILE);
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getProcessInstanceVariables(PROCESS_INSTACE_ID);
@@ -347,7 +347,7 @@
 
     @Test
     public void test_GetProcessInstanceVariables_SuccessResponseWithEmptyDataFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withSuccess(EMPTY_ARRAY_RESPONSE, MediaType.APPLICATION_JSON));
 
         final Response response = objUnderTest.getProcessInstanceVariables(PROCESS_INSTACE_ID);
@@ -358,7 +358,7 @@
 
     @Test
     public void test_GetProcessInstanceVariables_BadRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withBadRequest());
 
         final Response response = objUnderTest.getProcessInstanceVariables(PROCESS_INSTACE_ID);
@@ -369,7 +369,7 @@
 
     @Test
     public void test_GetProcessInstanceVariables_UnauthorizedRequestFromCamunda() throws Exception {
-        this.camundaMockServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
+        this.mockRestServiceServer.expect(requestTo(urlProvider.getProcessInstanceVariablesUrl(PROCESS_INSTACE_ID)))
                 .andRespond(withUnauthorizedRequest());
 
         final Response response = objUnderTest.getProcessInstanceVariables(PROCESS_INSTACE_ID);
@@ -396,8 +396,9 @@
     @Test
     public void test_GetInfraActiveRequests_SuccessResponseWithSoInfraRequestList() throws Exception {
         final String jsonString = getJsonResponse(SEARCH_RESULT_RESPONSE_JSON_FILE);
-        this.databaseMockServer
+        this.mockRestServiceServer
                 .expect(requestTo(databaseUrlProvider.getSearchUrl(START_TIME_IN_MS, END_TIME_IN_MS, null)))
+                .andExpect(header(AUTHORIZATION_HEADER, DATABASE_BASIC_AUTH))
                 .andRespond(withSuccess(jsonString, MediaType.APPLICATION_JSON));
 
         final Response response =
