diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractorTest.java
new file mode 100644
index 0000000..c373840
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractorTest.java
@@ -0,0 +1,68 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.appc.flow.controller.node;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
+import org.onap.appc.flow.controller.interfaceData.Capabilities;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+public class CapabilitiesDataExtractorTest {
+
+  private CapabilitiesDataExtractor capabilitiesDataExtractor;
+  private FlowControlDBService dbService;
+  private SvcLogicContext ctx;
+
+  @Before
+  public void setUp() {
+    dbService = mock(FlowControlDBService.class);
+    ctx = mock(SvcLogicContext.class);
+    capabilitiesDataExtractor = new CapabilitiesDataExtractor(dbService);
+  }
+
+  @Test
+  public void should_handle_capabilities_full_config() throws Exception {
+
+    String jsonPayload = "{'vnf':['vnf-1', 'vnf-2'],'vf-module':['vf-module-1', 'vf-module-2'],'vnfc':['vnfc-1', 'vnfc-2'],'vm':['vm-1', 'vm-2']}";
+    when(dbService.getCapabilitiesData(ctx)).thenReturn(jsonPayload.replaceAll("'","\""));
+
+    Capabilities capabilitiesData = capabilitiesDataExtractor.getCapabilitiesData(ctx);
+
+    Assert.assertEquals("Capabilities [vnf=[vnf-1, vnf-2], vfModule=[vf-module-1, vf-module-2], vm=[vm-1, vm-2], vnfc=[vnfc-1, vnfc-2]]", capabilitiesData.toString());
+  }
+
+  @Test
+  public void should_handle_capabilities_config_with_missing_params() throws Exception {
+
+    // CASE: vm is empty, vnfc is absent
+    String jsonPayload = "{'vnf':['vnf-1', 'vnf-2'],'vf-module':['vf-module-1'],'vm':[]}";
+    when(dbService.getCapabilitiesData(ctx)).thenReturn(jsonPayload.replaceAll("'","\""));
+
+    Capabilities capabilitiesData = capabilitiesDataExtractor.getCapabilitiesData(ctx);
+
+    Assert.assertEquals("Capabilities [vnf=[vnf-1, vnf-2], vfModule=[vf-module-1], vm=[], vnfc=[]]", capabilitiesData.toString());
+  }
+
+}
\ No newline at end of file
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowControlNodeTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowControlNodeTest.java
index d171f5f..b3c4792 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowControlNodeTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowControlNodeTest.java
@@ -36,67 +36,23 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
-import org.onap.appc.flow.controller.interfaceData.Capabilities;
 import org.onap.appc.flow.controller.interfaceData.DependencyInfo;
 import org.onap.appc.flow.controller.interfaceData.Vnfcs;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 
 public class FlowControlNodeTest {
 
-  private SvcLogicContext ctx;
   private FlowControlDBService dbService;
+  private SvcLogicContext ctx;
+  private FlowControlNode flowControlNode;
+  private FlowSequenceGenerator flowSequenceGenerator;
 
   @Before
   public void setUp() {
     ctx = mock(SvcLogicContext.class);
     dbService = mock(FlowControlDBService.class);
-  }
+    flowSequenceGenerator = mock(FlowSequenceGenerator.class);
 
-  @Test
-  public void should_handle_capabilities_full_config() throws Exception {
-
-    String jsonPayload = "{'vnf':['vnf-1', 'vnf-2'],'vf-module':['vf-module-1', 'vf-module-2'],'vnfc':['vnfc-1', 'vnfc-2'],'vm':['vm-1', 'vm-2']}";
-    when(dbService.getCapabilitiesData(ctx)).thenReturn(jsonPayload.replaceAll("'","\""));
-
-    FlowControlNode flowControlNode = new FlowControlNode(null, dbService);
-    Capabilities capabilitiesData = flowControlNode.getCapabilitiesData(ctx);
-
-    Assert.assertEquals("Capabilities [vnf=[vnf-1, vnf-2], vfModule=[vf-module-1, vf-module-2], vm=[vm-1, vm-2], vnfc=[vnfc-1, vnfc-2]]", capabilitiesData.toString());
-  }
-
-  @Test
-  public void should_handle_capabilities_config_with_missing_params() throws Exception {
-
-    // vm is empty, vnfc is absent
-    String jsonPayload = "{'vnf':['vnf-1', 'vnf-2'],'vf-module':['vf-module-1'],'vm':[]}";
-    when(dbService.getCapabilitiesData(ctx)).thenReturn(jsonPayload.replaceAll("'","\""));
-
-    FlowControlNode flowControlNode = new FlowControlNode(null, dbService);
-    Capabilities capabilitiesData = flowControlNode.getCapabilitiesData(ctx);
-
-    Assert.assertEquals("Capabilities [vnf=[vnf-1, vnf-2], vfModule=[vf-module-1], vm=[], vnfc=[]]", capabilitiesData.toString());
-  }
-
-  @Test
-  public void should_handle_dependency_config() throws Exception {
-
-    Vnfcs vnfcs = new Vnfcs();
-    vnfcs.setVnfcType("some-type");
-    vnfcs.setResilience("some-resilence");
-    vnfcs.setMandatory("some-mandatory");
-    Map<String, List<Vnfcs>> input = new HashMap<>();
-    List<Vnfcs> list = new ArrayList<>();
-    list.add(vnfcs);
-    list.add(vnfcs);
-    input.put("vnfcs", list);
-
-    String jsonPayload = new ObjectMapper().writeValueAsString(input);
-
-    when(dbService.getDependencyInfo(ctx)).thenReturn(jsonPayload);
-
-    FlowControlNode flowControlNode = new FlowControlNode(null, dbService);
-    DependencyInfo dependencyInfo = flowControlNode.getDependencyInfo(ctx);
-
-    Assert.assertEquals("DependencyInfo [vnfcs=[Vnfcs [vnfcType=some-type, mandatory=some-mandatory, resilience=some-resilence, parents=[]], Vnfcs [vnfcType=some-type, mandatory=some-mandatory, resilience=some-resilence, parents=[]]]]", dependencyInfo.toString());
+    flowControlNode = new FlowControlNode(dbService, flowSequenceGenerator);
   }
 }
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowGeneratorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowGeneratorTest.java
index 5981fc0..1d4fb69 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowGeneratorTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowGeneratorTest.java
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.appc.flow.controller.node;
 
 import static org.mockito.Mockito.mock;
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowSequenceGeneratorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowSequenceGeneratorTest.java
new file mode 100644
index 0000000..533de58
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/FlowSequenceGeneratorTest.java
@@ -0,0 +1,208 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.appc.flow.controller.node;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.appc.flow.controller.node.FlowSequenceGenerator.MODULE;
+import static org.onap.appc.flow.controller.node.InputParamsCollector.SDNC_CONFIG_DIR_VAR;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.DESINGTIME;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.EXTERNAL;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.FLOW_SEQUENCE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.GENERATION_NODE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.RUNTIME;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.SEQUENCE_TYPE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNFC_TYPE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNF_ID;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNF_TYPE;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onap.appc.flow.controller.data.Transaction;
+import org.onap.appc.flow.controller.data.Transactions;
+import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
+import org.onap.appc.flow.controller.executorImpl.GraphExecutor;
+import org.onap.appc.flow.controller.executorImpl.RestExecutor;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+public class FlowSequenceGeneratorTest {
+
+  private FlowControlDBService dbService;
+  private Map<String, String> inParams;
+  private SvcLogicContext localCtx;
+  private SvcLogicContext ctx;
+  private FlowGenerator flowGenerator;
+  private GraphExecutor graphExecutor;
+  private FlowSequenceGenerator flowSequenceGenerator;
+  private RestExecutor restExecutor;
+
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  @Before
+  public void setUp() {
+    inParams = new HashMap<>();
+    ctx = mock(SvcLogicContext.class);
+    localCtx = mock(SvcLogicContext.class);
+    dbService = mock(FlowControlDBService.class);
+    flowGenerator = mock(FlowGenerator.class);
+    graphExecutor = mock(GraphExecutor.class);
+    restExecutor = mock(RestExecutor.class);
+
+    EnvVariables envVariables = mock(EnvVariables.class);
+
+    when(envVariables.getenv(SDNC_CONFIG_DIR_VAR)).thenReturn("./src/test/resources");
+
+    flowSequenceGenerator = new FlowSequenceGenerator(
+        dbService,
+        flowGenerator,
+        graphExecutor,
+        restExecutor,
+        envVariables
+    );
+  }
+
+  @Test
+  public void sequence_type_is_null() throws Exception {
+
+    Transaction transaction = new Transaction();
+    transaction.setExecutionType("mock-flow-generator");
+    ArrayList<Transaction> transactionList = new ArrayList<>();
+    transactionList.add(transaction);
+    Transactions transactions = new Transactions();
+    transactions.setTransactions(transactionList);
+
+    when(flowGenerator.createSingleStepModel(inParams, ctx)).thenReturn(transactions);
+
+    String seq = flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+
+    Assert.assertEquals("{\"transactions\":[{\"executionType\":\"mock-flow-generator\",\"uId\":null,\"statusCode\":null,\"pswd\":null,\"executionEndPoint\":null,\"executionModule\":null,\"executionRPC\":null,\"status\":\"PENDING\",\"transaction-id\":0,\"action\":null,\"action-level\":null,\"action-identifier\":null,\"parameters\":null,\"state\":null,\"precheck\":null,\"payload\":null,\"responses\":null}]}", seq);
+  }
+
+  @Test
+  public void sequence_type_is_not_null_generator_and_generator_node_exists() throws Exception {
+
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn("some-seq-type");
+    when(localCtx.getAttribute(GENERATION_NODE)).thenReturn("some-gen-node");
+
+    when(graphExecutor.hasGraph(MODULE, "some-gen-node", null,"sync")).thenReturn(true);
+
+    Properties properties = new Properties();
+    properties.setProperty(FLOW_SEQUENCE, "flow-sequence");
+    when(graphExecutor.executeGraph(MODULE, "some-gen-node", null, "sync", null)).thenReturn(properties);
+
+    String seq = flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+
+    Assert.assertEquals("flow-sequence", seq);
+  }
+
+  @Test
+  public void sequence_type_is_not_null_generator_exists_but_generator_node_not_exists() throws Exception {
+
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn("some-seq-type");
+    when(localCtx.getAttribute(GENERATION_NODE)).thenReturn("some-gen-node");
+
+    when(graphExecutor.hasGraph(MODULE, "some-gen-node", null,"sync")).thenReturn(false);
+
+    expectedException.expectMessage("Can not find Custom defined Flow Generator for some-gen-node");
+    flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+  }
+
+  @Test
+  public void sequence_type_is_design_time() throws Exception {
+
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn(DESINGTIME);
+    when(dbService.getDesignTimeFlowModel(localCtx)).thenReturn("flow-sequence");
+
+    String flowSequence = flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+    verify(localCtx).setAttribute(VNFC_TYPE, ctx.getAttribute(VNFC_TYPE));
+
+    Assert.assertEquals("flow-sequence", flowSequence);
+  }
+
+  @Test
+  public void sequence_type_is_design_time_but_got_null() throws Exception {
+
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn(DESINGTIME);
+    when(ctx.getAttribute(VNF_TYPE)).thenReturn("some-vnf-type");
+    when(dbService.getDesignTimeFlowModel(localCtx)).thenReturn(null);
+
+    expectedException.expectMessage("Flow Sequence is not found User Designed VNF some-vnf-type");
+    flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+    verify(localCtx).setAttribute(VNFC_TYPE, ctx.getAttribute(VNFC_TYPE));
+  }
+
+  @Test
+  public void sequence_type_is_runtime() throws Exception {
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn(RUNTIME);
+    when(ctx.getAttribute(VNF_TYPE)).thenReturn("some-vnf-type");
+    when(ctx.getAttribute(VNF_ID)).thenReturn("some-vnf-id");
+
+    Map<String, String> map = new HashMap<>();
+    map.put("restResponse", "{'output':{'dummy-json-object':'some-param'}}".replaceAll("'", "\""));
+    when(restExecutor.execute(any(Transaction.class), eq(localCtx))).thenReturn(map);
+
+    String flowSequence = flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+
+    Assert.assertEquals("{'dummy-json-object':'some-param'}".replaceAll("'", "\""), flowSequence);
+  }
+
+  @Test
+  public void sequence_type_is_runtime_but_got_null() throws Exception {
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn(RUNTIME);
+    when(ctx.getAttribute(VNF_TYPE)).thenReturn("some-vnf-type");
+    when(ctx.getAttribute(VNF_ID)).thenReturn("some-vnf-id");
+
+    Map<String, String> map = new HashMap<>();
+    map.put("restResponse", "{}".replaceAll("'", "\""));
+    when(restExecutor.execute(any(Transaction.class), eq(localCtx))).thenReturn(map);
+
+    expectedException.expectMessage("Failed to get the Flow Sequence runtime for VNF type some-vnf-type");
+    flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+  }
+
+  @Test
+  public void sequence_type_is_external() throws Exception {
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn(EXTERNAL);
+    when(ctx.getAttribute(VNF_TYPE)).thenReturn("some-vnf-type");
+
+    expectedException.expectMessage("Flow Sequence not found for some-vnf-type");
+    flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+  }
+
+  @Test
+  public void unknown_sequence() throws Exception {
+    when(localCtx.getAttribute(SEQUENCE_TYPE)).thenReturn("some-unknown-type");
+
+    expectedException.expectMessage("No information found for sequence Owner Design-Time Vs Run-Time");
+    flowSequenceGenerator.getFlowSequence(inParams, ctx, localCtx);
+  }
+
+}
\ No newline at end of file
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/InputParamsCollectorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/InputParamsCollectorTest.java
new file mode 100644
index 0000000..dbf821e
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/InputParamsCollectorTest.java
@@ -0,0 +1,130 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.appc.flow.controller.node;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.appc.flow.controller.node.InputParamsCollector.SDNC_CONFIG_DIR_VAR;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.ACTION_LEVEL;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.PAYLOAD;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.REQUEST_ACTION;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNFC_NAME;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNF_ID;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VSERVER_ID;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.appc.flow.controller.data.Transaction;
+import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
+import org.onap.appc.flow.controller.interfaceData.DependencyInfo;
+import org.onap.appc.flow.controller.interfaceData.Vnfcs;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+public class InputParamsCollectorTest {
+
+  private SvcLogicContext ctx;
+  private FlowControlDBService dbService;
+  private EnvVariables envVariables;
+  private InputParamsCollector inputParamsCollector;
+
+  @Before
+  public void setUp() {
+
+    ctx = mock(SvcLogicContext.class);
+    dbService = mock(FlowControlDBService.class);
+    envVariables = mock(EnvVariables.class);
+
+    when(envVariables.getenv(SDNC_CONFIG_DIR_VAR)).thenReturn("./src/test/resources");
+
+    inputParamsCollector = new InputParamsCollector(envVariables, dbService);
+  }
+
+  @Test
+  public void should_collect_input_params() throws Exception {
+
+    when(ctx.getAttribute(VNF_ID)).thenReturn("some-vnf-id");
+    when(ctx.getAttribute(REQUEST_ACTION)).thenReturn("some-request-action");
+    when(ctx.getAttribute(ACTION_LEVEL)).thenReturn("some-action-level");
+    when(ctx.getAttribute(PAYLOAD)).thenReturn("some-payload");
+    when(ctx.getAttribute(VSERVER_ID)).thenReturn("some-vserver-id");
+    when(ctx.getAttribute(VNFC_NAME)).thenReturn("some-vnfc-name");
+
+    when(dbService.getCapabilitiesData(ctx)).thenReturn(
+        "{'vnf':['vnf-1', 'vnf-2'],'vf-module':['vf-module-1', 'vf-module-2'],'vnfc':['vnfc-1', 'vnfc-2'],'vm':['vm-1', 'vm-2']}"
+            .replaceAll("'", "\""));
+    when(dbService.getDependencyInfo(ctx)).thenReturn(dependencyInfoPayload());
+
+    Transaction transaction = inputParamsCollector.collectInputParams(ctx);
+
+    Assert.assertEquals(
+        "{\"input\":{\"request-info\":{\"action\":\"some-request-action\",\"payload\":\"some-payload\",\"action-level\":\"some-action-level\",\"action-identifier\":{\"vnf-id\":\"some-vnf-id\",\"vserver-id\":\"some-vserver-id\",\"vnfc-name\":\"some-vnfc-name\"}},\"inventory-info\":{\"vnf-info\":{\"vnf-id\":\"some-vnf-id\",\"vm\":[]}},\"dependency-info\":{\"vnfcs\":[{\"vnfc-type\":\"some-type\",\"mandatory\":\"some-mandatory\",\"resilience\":\"some-resilience\",\"parents\":[]},{\"vnfc-type\":\"some-type\",\"mandatory\":\"some-mandatory\",\"resilience\":\"some-resilience\",\"parents\":[]}]},\"capabilities\":{\"vnf\":[\"vnf-1\",\"vnf-2\"],\"vm\":[\"vm-1\",\"vm-2\"],\"vnfc\":[\"vnfc-1\",\"vnfc-2\"],\"vf-module\":[\"vf-module-1\",\"vf-module-2\"]}}}",
+        transaction.getPayload());
+    Assert.assertEquals("POST", transaction.getExecutionRPC());
+    Assert.assertEquals("seq-generator-uid", transaction.getuId());
+    Assert.assertEquals("some-pswd", transaction.getPswd());
+    Assert.assertEquals("exec-endpoint", transaction.getExecutionEndPoint());
+  }
+
+  @Test
+  public void should_handle_dependency_config() throws Exception {
+
+    Vnfcs vnfcs = new Vnfcs();
+    vnfcs.setVnfcType("some-type");
+    vnfcs.setResilience("some-resilience");
+    vnfcs.setMandatory("some-mandatory");
+    Map<String, List<Vnfcs>> input = new HashMap<>();
+    List<Vnfcs> list = new ArrayList<>();
+    list.add(vnfcs);
+    list.add(vnfcs);
+    input.put("vnfcs", list);
+
+    String jsonPayload = new ObjectMapper().writeValueAsString(input);
+
+    when(dbService.getDependencyInfo(ctx)).thenReturn(jsonPayload);
+
+    DependencyInfo dependencyInfo = inputParamsCollector.getDependencyInfo(ctx);
+
+    Assert.assertEquals(
+        "DependencyInfo [vnfcs=[Vnfcs [vnfcType=some-type, mandatory=some-mandatory, resilience=some-resilience, parents=[]], Vnfcs [vnfcType=some-type, mandatory=some-mandatory, resilience=some-resilience, parents=[]]]]",
+        dependencyInfo.toString());
+  }
+
+  private String dependencyInfoPayload() throws JsonProcessingException {
+    Vnfcs vnfcs = new Vnfcs();
+    vnfcs.setVnfcType("some-type");
+    vnfcs.setResilience("some-resilience");
+    vnfcs.setMandatory("some-mandatory");
+    Map<String, List<Vnfcs>> input = new HashMap<>();
+    List<Vnfcs> list = new ArrayList<>();
+    list.add(vnfcs);
+    list.add(vnfcs);
+    input.put("vnfcs", list);
+
+    return new ObjectMapper().writeValueAsString(input);
+  }
+
+}
\ No newline at end of file
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/JsonValidatorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/JsonValidatorTest.java
index fd6f920..e1a412d 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/JsonValidatorTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/JsonValidatorTest.java
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.appc.flow.controller.node;
 
 import com.fasterxml.jackson.databind.JsonNode;
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/PropertiesLoaderTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/PropertiesLoaderTest.java
index 66bf802..10bd940 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/PropertiesLoaderTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/PropertiesLoaderTest.java
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.appc.flow.controller.node;
 
 import java.io.FileNotFoundException;
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/ResourceUriExtractorTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/ResourceUriExtractorTest.java
index 28a202c..e3f108e 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/ResourceUriExtractorTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/ResourceUriExtractorTest.java
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.appc.flow.controller.node;
 
 import static org.mockito.Mockito.mock;
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TestRestServiceNode.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TestRestServiceNode.java
index 20a1fd3..fdf665a 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TestRestServiceNode.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TestRestServiceNode.java
@@ -27,6 +27,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
+import static org.onap.appc.flow.controller.node.InputParamsCollector.SDNC_CONFIG_DIR_VAR;
 import static org.onap.appc.flow.controller.node.RestServiceNode.REST_RESPONSE;
 import static org.onap.appc.flow.controller.utils.FlowControllerConstants.INPUT_PARAM_RESPONSE_PREFIX;
 
@@ -47,7 +48,6 @@
 public class TestRestServiceNode {
 
   private static final String RESOURCE_URI = "resource-uri";
-  private static final String MOCK_ENV = "src/test/resources";
   private static final String REST_BODY_RESPONSE = "{ 'state' : 'TEST' }";
 
   private RestServiceNode restServiceNode;
@@ -87,7 +87,8 @@
     when(restExecutorMock.execute(eq(transaction), any(SvcLogicContext.class)))
         .thenReturn(restResponseMap);
 
-    EnvVariables envVariables = new EnvVariables(envKey -> MOCK_ENV);
+    EnvVariables envVariables = mock(EnvVariables.class);
+    when(envVariables.getenv(SDNC_CONFIG_DIR_VAR)).thenReturn("src/test/resources");
     restServiceNode = new RestServiceNode(transactionHandlerMock, restExecutorMock, uriExtractorMock, envVariables);
   }
 
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TransactionHandlerTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TransactionHandlerTest.java
index 637a9ea..158e0c9 100644
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TransactionHandlerTest.java
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/TransactionHandlerTest.java
@@ -1,24 +1,22 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * Copyright (C) 2018 Nokia. All rights reserved.
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
- *  * ============LICENSE_END=========================================================
+ * ============LICENSE_END=========================================================
  */
-
 package org.onap.appc.flow.controller.node;
 
 import static org.mockito.Mockito.mock;
diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/executor/node/FlowControlNodeTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/executor/node/FlowControlNodeTest.java
deleted file mode 100644
index ba6f0c7..0000000
--- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/executor/node/FlowControlNodeTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * =============================================================================
- * 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.
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.appc.flow.executor.node;
-
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.onap.appc.flow.controller.data.Transaction;
-import org.onap.appc.flow.controller.data.Transactions;
-import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
-import org.onap.appc.flow.controller.node.FlowControlNode;
-import org.onap.appc.flow.controller.utils.FlowControllerConstants;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.reflect.Whitebox;
-
-public class FlowControlNodeTest {
-  @Mock
-  FlowControlDBService dbservice = FlowControlDBService.initialise();
-  @Mock
-  FlowControlNode f = new FlowControlNode();
-
-  Properties props = new Properties();
-  private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
-  @Before
-  public void setUp() throws Exception
-
-  {
-    FlowControlDBService dbservice = FlowControlDBService.initialise();
-  }
-  @Ignore("Test is taking 60 seconds")
-  @Test(expected=Exception.class)
-  public final void testProcessFlow() throws Exception {
-    SvcLogicContext  ctx = new SvcLogicContext();
-
-    ctx.setAttribute("request-id","test");
-    ctx.setAttribute("vnf-type","test");
-    ctx.setAttribute("action-level","HealthCheck");
-    ctx.setAttribute("request-action","HealthCheck");
-    ctx.setAttribute("response-prefix","response-prefix");
-
-    Map<String, String> inParams = new HashMap<String, String>();
-    inParams.put("responsePrefix", "responsePrefix");
-
-
-    Whitebox.invokeMethod(f, "processFlow",inParams, ctx);
-		/*Properties props = new Properties();
-		PowerMockito.spy(FlowControlNode.class);
-	      Transactions trans =null;
-	      HashMap<Integer, Transaction> transactionMap = null;
-	    	 String  artifact_content="{‘PlaybookName’:’service_start’,‘EnvParameters’:{‘vnf_instance’:’$vnf_instance’},’Timeout’:600}";
-			String capabilitiesData = "SUCCESS";
-	      System.out.println("End Test when");*/
-
-
-  }
-  @Ignore("Test is taking 60 seconds")
-  @Test(expected=Exception.class)
-  public void testprocessFlowSequence() throws Exception
-  {
-    Map<String, String> inparams = new HashMap<String,String>();
-    SvcLogicContext  ctx = new SvcLogicContext();
-    ctx.setAttribute( " SEQUENCE-TYPE","test");
-    ctx.setAttribute("flow-sequence", "1");
-    ctx.setAttribute( "DesignTime","test");
-    ctx.setAttribute( "vnf-type","test" );
-
-    Whitebox.invokeMethod(f, "processFlowSequence",inparams, ctx, ctx);
-
-  }
-  @Test
-  public void testexeuteAllTransaction() throws Exception
-  {
-    Map<Integer, Transaction> transactionMap = new HashMap<Integer,Transaction>();
-    SvcLogicContext  ctx = new SvcLogicContext();
-    Whitebox.invokeMethod(f, "executeAllTransaction",transactionMap, ctx);
-
-  }
-  @Test
-  public void testexeutepreProcessor() throws Exception
-  {
-    Map<Integer, Transaction> transactionMap = new HashMap<Integer,Transaction>();
-    Transaction transaction = new Transaction();
-    Whitebox.invokeMethod(f, "preProcessor",transactionMap, transaction);
-
-  }
-  @Test(expected=Exception.class)
-  public void testcollectInputParams() throws Exception
-  {
-    SvcLogicContext  ctx = new SvcLogicContext();
-
-    Transaction transaction = new Transaction();
-    Whitebox.invokeMethod(f, "collectInputParams",ctx, transaction);
-
-  }
-  @Ignore("Test is taking 60 seconds")
-  @Test(expected=Exception.class)
-  public void testgetDependencyInfo() throws Exception
-  {
-    SvcLogicContext  ctx = new SvcLogicContext();
-    Whitebox.invokeMethod(f, "getDependencyInfo",ctx);
-
-  }
-  public void testgetCapabilitesDatass() throws Exception
-  {
-    SvcLogicContext  ctx = new SvcLogicContext();
-    Whitebox.invokeMethod(f, "getDependencyInfo",ctx);
-
-  }
-
-
-}
diff --git a/appc-config/appc-flow-controller/provider/src/test/resources/appc-flow-controller.properties b/appc-config/appc-flow-controller/provider/src/test/resources/appc-flow-controller.properties
index 0bbe7f2..e09a85e 100644
--- a/appc-config/appc-flow-controller/provider/src/test/resources/appc-flow-controller.properties
+++ b/appc-config/appc-flow-controller/provider/src/test/resources/appc-flow-controller.properties
@@ -23,3 +23,6 @@
 healthcheck.mock=false
 healthcheck.default-rest-user=User
 healthcheck.default-rest-pass=@#asd723%^
+seq_generator.uid=seq-generator-uid
+seq_generator.pwd=some-pswd
+seq_generator_url=exec-endpoint
