diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractor.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractor.java
new file mode 100644
index 0000000..b740e4f
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/CapabilitiesDataExtractor.java
@@ -0,0 +1,95 @@
+/*
+ * ============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.onap.appc.flow.controller.utils.FlowControllerConstants.VF_MODULE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VM;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNF;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.VNFC;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
+import org.onap.appc.flow.controller.interfaceData.Capabilities;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+
+public class CapabilitiesDataExtractor {
+
+  private static final EELFLogger log = EELFManager.getInstance().getLogger(CapabilitiesDataExtractor.class);
+
+  private final FlowControlDBService dbService;
+  private final ObjectMapper mapper;
+
+  public CapabilitiesDataExtractor() {
+    this(FlowControlDBService.initialise());
+  }
+
+  /**
+   * Ctor for tests, prefer to use default one
+   */
+  public CapabilitiesDataExtractor(FlowControlDBService dbService) {
+    this.dbService = dbService;
+
+    mapper = new ObjectMapper();
+    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+    mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+  }
+
+  Capabilities getCapabilitiesData(SvcLogicContext ctx) throws SvcLogicException, IOException {
+
+    String fn = "FlowExecutorNode.getCapabilitiesData";
+    String capabilitiesData = dbService.getCapabilitiesData(ctx);
+    log.info(fn + "capabilitiesDataInput:" + capabilitiesData);
+
+    Capabilities capabilities = new Capabilities();
+    if (capabilitiesData == null) {
+      return capabilities;
+    }
+
+    JsonNode capabilitiesNode = mapper.readTree(capabilitiesData);
+    log.info("capabilitiesNode:" + capabilitiesNode.toString());
+
+    capabilities.getVfModule().addAll(extractParameterList(capabilitiesNode, VF_MODULE));
+    capabilities.getVnfc().addAll(extractParameterList(capabilitiesNode, VNFC));
+    capabilities.getVnf().addAll(extractParameterList(capabilitiesNode, VNF));
+    capabilities.getVm().addAll(extractParameterList(capabilitiesNode, VM));
+
+    log.info("Capabilities Output:" + capabilities.toString());
+
+    return capabilities;
+  }
+
+  private <T> List<T> extractParameterList(JsonNode root, String parameter) throws IOException {
+    JsonNode parameterNode = root.get(parameter);
+    if (parameterNode == null) {
+      return new ArrayList<>();
+    }
+    return mapper.readValue(parameterNode.toString(), new TypeReference<List<T>>() {});
+  }
+
+}
\ No newline at end of file
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/EnvVariables.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/EnvVariables.java
index 6cc3b75..bac1f6c 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/EnvVariables.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/EnvVariables.java
@@ -1,9 +1,30 @@
+/*
+ * ============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.util.function.Function;
 
 /**
- * Wrapper for accessing environment variables
+ * Wrapper which allows to mock static calls of System.getenv()
+ *
+ * @see System#getenv()
  */
 class EnvVariables {
 
@@ -13,13 +34,6 @@
     envSupplier = System::getenv;
   }
 
-  /**
-   * Allows to override environment variables in tests, prefer to use default constructor
-   */
-  EnvVariables(Function<String, String> envSupplier) {
-    this.envSupplier = envSupplier;
-  }
-
   String getenv(String variable) {
     return envSupplier.apply(variable);
   }
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowControlNode.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowControlNode.java
index 28130e7..fd88360 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowControlNode.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowControlNode.java
@@ -97,19 +97,18 @@
 public class FlowControlNode implements SvcLogicJavaPlugin {
 
   private static final EELFLogger log = EELFManager.getInstance().getLogger(FlowControlNode.class);
-  private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
 
-  private final EnvVariables envVariables;
   private final FlowControlDBService dbService;
+  private final FlowSequenceGenerator flowSequenceGenerator;
 
   public FlowControlNode() {
-    this.envVariables = new EnvVariables();
     this.dbService = FlowControlDBService.initialise();
+    this.flowSequenceGenerator = new FlowSequenceGenerator();
   }
 
-  FlowControlNode(EnvVariables envVariables, FlowControlDBService dbService) {
-    this.envVariables = envVariables;
+  FlowControlNode(FlowControlDBService dbService, FlowSequenceGenerator flowSequenceGenerator) {
     this.dbService = dbService;
+    this.flowSequenceGenerator = flowSequenceGenerator;
   }
 
   public void processFlow(Map<String, String> inParams, SvcLogicContext ctx)
@@ -154,7 +153,7 @@
         .getAttributeKeySet()
         .forEach(key -> log.debug(key + "=" + ctx.getAttribute(key)));
 
-    String flowSequence = getFlowSequence(inParams, ctx, localContext);
+    String flowSequence = flowSequenceGenerator.getFlowSequence(inParams, ctx, localContext);
 
     log.debug("Received Flow Sequence : " + flowSequence);
     HashMap<Integer, Transaction> transactionMap = createTransactionMap(flowSequence, localContext);
@@ -162,81 +161,6 @@
     log.info("Executed all the transaction successfully");
   }
 
-  String getFlowSequence(Map<String, String> inParams, SvcLogicContext ctx, SvcLogicContext localContext) throws Exception {
-    String flowSequence = null;
-    if (localContext.getAttribute(SEQUENCE_TYPE) != null) {
-      if (localContext.getAttribute(GENERATION_NODE) != null) {
-        GraphExecutor transactionExecutor = new GraphExecutor();
-        Boolean generatorExists = transactionExecutor.hasGraph(
-            "APPC_COMMOM",
-            localContext.getAttribute(GENERATION_NODE),
-            null,
-            "sync"
-        );
-
-        if (generatorExists) {
-          flowSequence = transactionExecutor.executeGraph(
-              "APPC_COMMOM",
-              localContext.getAttribute(GENERATION_NODE),
-              null, "sync", null)
-              .getProperty(FLOW_SEQUENCE);
-        } else {
-          throw new Exception("Can not find Custom defined Flow Generator for "
-              + localContext.getAttribute(GENERATION_NODE));
-        }
-
-      } else if ((localContext.getAttribute(SEQUENCE_TYPE)).equalsIgnoreCase(DESINGTIME)) {
-
-        localContext.setAttribute(VNFC_TYPE, ctx.getAttribute(VNFC_TYPE));
-        flowSequence = dbService.getDesignTimeFlowModel(localContext);
-
-        if (flowSequence == null) {
-          throw new Exception("Flow Sequence is not found User Designed VNF " + ctx.getAttribute(VNF_TYPE));
-        }
-
-      } else if ((localContext.getAttribute(SEQUENCE_TYPE)).equalsIgnoreCase(RUNTIME)) {
-
-        Transaction transaction = new Transaction();
-        String input = collectInputParams(ctx, transaction);
-        log.info("CollectInputParamsData-Input: " + input);
-
-        RestExecutor restExe = new RestExecutor();
-        Map<String, String> flowSeq = restExe.execute(transaction, localContext);
-
-        JSONObject sequence = new JSONObject(flowSeq.get("restResponse"));
-        if (sequence.has("output")) {
-          flowSequence = sequence.getJSONObject("output").toString();
-        }
-        log.info("MultistepSequenceGenerator-Output: " + flowSequence);
-
-        if (flowSequence == null) {
-          throw new Exception("Failed to get the Flow Sequece runtime for VNF type"
-              + ctx.getAttribute(VNF_TYPE));
-        }
-
-      } else if ((localContext.getAttribute(SEQUENCE_TYPE)).equalsIgnoreCase(EXTERNAL)) {
-        //String input = collectInputParams(localContext);
-        //    flowSequnce = ""; //get it from the External interface calling the Rest End point - TBD
-        //if(flowSequnce == null)
-
-        throw new Exception("Flow Sequence not found for " + ctx.getAttribute(VNF_TYPE));
-
-      } else {
-        //No other type of model supported...
-        //in Future can get flowModel from other generators which will be included here
-        throw new Exception("No information found for sequence Owner Design-Time Vs Run-Time");
-      }
-
-    } else {
-      FlowGenerator flowGenerator = new FlowGenerator();
-      Transactions trans = flowGenerator.createSingleStepModel(inParams, ctx);
-      ObjectMapper mapper = new ObjectMapper();
-      flowSequence = mapper.writeValueAsString(trans);
-      log.debug("Single step Flow Sequence : " + flowSequence);
-    }
-    return flowSequence;
-  }
-
   private void executeAllTransaction(HashMap<Integer, Transaction> transactionMap, SvcLogicContext ctx)
       throws Exception {
 
@@ -380,143 +304,4 @@
     //get a field in transction class as transactionhandle interface and register the Handler here for each trnactions
   }
 
-  private String collectInputParams(SvcLogicContext ctx, Transaction transaction) throws Exception {
-
-    String fn = "FlowExecuteNode.collectInputParams";
-    Properties prop = loadProperties();
-    log.info("Loaded Properties " + prop.toString());
-
-    String vnfId = ctx.getAttribute(VNF_ID);
-    String inputData = null;
-    log.debug(fn + "vnfId :" + vnfId);
-
-    if (StringUtils.isBlank(vnfId)) {
-      throw new Exception("VnfId is missing");
-    }
-
-    try {
-      ActionIdentifier actionIdentifier = new ActionIdentifier();
-      log.debug("Enter ActionIdentifier");
-      if (StringUtils.isNotBlank(vnfId)) {
-        actionIdentifier.setVnfId(vnfId);
-      }
-      if (StringUtils.isNotBlank(ctx.getAttribute(VSERVER_ID))) {
-        actionIdentifier.setVserverId(ctx.getAttribute(VSERVER_ID));
-      }
-      if (StringUtils.isNotBlank(ctx.getAttribute(VNFC_NAME))) {
-        actionIdentifier.setVnfcName(ctx.getAttribute(VNFC_NAME));
-      }
-      log.info("ActionIdentifierData" + actionIdentifier.toString());
-
-      RequestInfo requestInfo = new RequestInfo();
-      log.info("Enter RequestInfo");
-      requestInfo.setAction(ctx.getAttribute(REQUEST_ACTION));
-      requestInfo.setActionLevel(ctx.getAttribute(ACTION_LEVEL));
-      requestInfo.setPayload(ctx.getAttribute(PAYLOAD));
-      requestInfo.setActionIdentifier(actionIdentifier);
-      log.debug("RequestInfo: " + requestInfo.toString());
-
-      InventoryInfo inventoryInfo = new InventoryInfoExtractor().getInventoryInfo(ctx, vnfId);
-      DependencyInfo dependencyInfo = getDependencyInfo(ctx);
-      Capabilities capabilities = getCapabilitiesData(ctx);
-
-      Input input = new Input();
-      log.info("Enter InputData");
-      input.setRequestInfo(requestInfo);
-      input.setInventoryInfo(inventoryInfo);
-      input.setDependencyInfo(dependencyInfo);
-      input.setCapabilities(capabilities);
-      log.info(fn + "Input parameters:" + input.toString());
-
-      ObjectMapper mapper = new ObjectMapper();
-      mapper.setSerializationInclusion(Include.NON_NULL);
-      mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
-      inputData = mapper.writeValueAsString(input);
-      log.info("InputDataJson:" + inputData);
-
-    } catch (Exception e) {
-      log.error("Error occurred in " + fn, e);
-    }
-
-    String resourceUri = prop.getProperty(SEQ_GENERATOR_URL);
-    log.info(fn + "resourceUri= " + resourceUri);
-
-    EncryptionTool et = EncryptionTool.getInstance();
-    String pass = et.decrypt(prop.getProperty(SEQ_GENERATOR_PWD));
-
-    transaction.setPayload(inputData);
-    transaction.setExecutionRPC("POST");
-    transaction.setuId(prop.getProperty(SEQ_GENERATOR_UID));
-    transaction.setPswd(pass);
-    transaction.setExecutionEndPoint(resourceUri);
-
-    return inputData;
-  }
-
-  DependencyInfo getDependencyInfo(SvcLogicContext ctx) throws SvcLogicException, IOException {
-
-    String fn = "FlowExecutorNode.getDependencyInfo";
-    String dependencyData = dbService.getDependencyInfo(ctx);
-    log.info(fn + "dependencyDataInput:" + dependencyData);
-
-    DependencyInfo dependencyInfo = new DependencyInfo();
-    if (dependencyData == null) {
-      return dependencyInfo;
-    }
-
-    ObjectMapper mapper = new ObjectMapper();
-    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-    mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
-    //JsonNode dependencyInfoData = mapper.readTree(dependencyData).get("dependencyInfo");
-    JsonNode vnfcData = mapper.readTree(dependencyData).get("vnfcs");
-    dependencyInfo.getVnfcs().addAll(mapper.readValue(vnfcData.toString(), new TypeReference<List<Vnfcs>>(){}));
-
-    log.info("Dependency Output:" + dependencyInfo.toString());
-    return dependencyInfo;
-  }
-
-  Capabilities getCapabilitiesData(SvcLogicContext ctx) throws SvcLogicException, IOException {
-
-    String fn = "FlowExecutorNode.getCapabilitiesData";
-    String capabilitiesData = dbService.getCapabilitiesData(ctx);
-    log.info(fn + "capabilitiesDataInput:" + capabilitiesData);
-
-    Capabilities capabilities = new Capabilities();
-    if (capabilitiesData == null) {
-      return capabilities;
-    }
-
-    ObjectMapper mapper = new ObjectMapper();
-    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-    mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
-
-    JsonNode capabilitiesNode = mapper.readTree(capabilitiesData);
-    log.info("capabilitiesNode:" + capabilitiesNode.toString());
-
-    capabilities.getVfModule().addAll(extractParameterList(mapper, capabilitiesNode, VF_MODULE));
-    capabilities.getVnfc().addAll(extractParameterList(mapper, capabilitiesNode, VNFC));
-    capabilities.getVnf().addAll(extractParameterList(mapper, capabilitiesNode, VNF));
-    capabilities.getVm().addAll(extractParameterList(mapper, capabilitiesNode, VM));
-
-    log.info("Capabilities Output:" + capabilities.toString());
-
-    return capabilities;
-  }
-
-  private <T> List<T> extractParameterList(ObjectMapper mapper, JsonNode root, String parameter) throws IOException {
-    JsonNode parameterNode = root.get(parameter);
-    if (parameterNode == null) {
-      return new ArrayList<>();
-    }
-    return mapper.readValue(parameterNode.toString(), new TypeReference<List<T>>() {});
-  }
-
-  private Properties loadProperties() throws Exception {
-    String directory = envVariables.getenv(SDNC_CONFIG_DIR_VAR);
-    if (directory == null) {
-      throw new Exception("Cannot find Property file -" + SDNC_CONFIG_DIR_VAR);
-    }
-    String path = directory + APPC_FLOW_CONTROLLER;
-    return PropertiesLoader.load(path);
-  }
 }
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowSequenceGenerator.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowSequenceGenerator.java
new file mode 100644
index 0000000..db57913
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/FlowSequenceGenerator.java
@@ -0,0 +1,149 @@
+/*
+ * ============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.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_TYPE;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.util.Map;
+import org.json.JSONObject;
+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;
+
+/**
+ * Helper class for FlowControlNode
+ */
+class FlowSequenceGenerator {
+
+  private static final EELFLogger log = EELFManager.getInstance().getLogger(FlowSequenceGenerator.class);
+
+  static final String MODULE = "APPC_COMMOM";
+
+  private final FlowControlDBService dbService;
+  private final FlowGenerator flowGenerator;
+  private final GraphExecutor transactionExecutor;
+  private final RestExecutor restExecutor;
+  private final InputParamsCollector inputParamsCollector;
+
+  FlowSequenceGenerator() {
+    this.dbService = FlowControlDBService.initialise();
+    this.flowGenerator = new FlowGenerator();
+    this.transactionExecutor = new GraphExecutor();
+    this.restExecutor = new RestExecutor();
+    this.inputParamsCollector = new InputParamsCollector();
+  }
+
+  /**
+   * Constructor for tests, prefer to use default one
+   */
+  FlowSequenceGenerator(FlowControlDBService dbService, FlowGenerator flowGenerator,
+      GraphExecutor graphExecutor, RestExecutor restExecutor, EnvVariables envVariables) {
+    this.dbService = dbService;
+    this.flowGenerator = flowGenerator;
+    this.transactionExecutor = graphExecutor;
+    this.restExecutor = restExecutor;
+    this.inputParamsCollector = new InputParamsCollector(envVariables, dbService);
+  }
+
+  String getFlowSequence(Map<String, String> inParams, SvcLogicContext ctx, SvcLogicContext localContext)
+      throws Exception {
+
+    String flowSequence;
+    if (localContext.getAttribute(SEQUENCE_TYPE) == null) {
+      Transactions trans = flowGenerator.createSingleStepModel(inParams, ctx);
+      ObjectMapper mapper = new ObjectMapper();
+      flowSequence = mapper.writeValueAsString(trans);
+      log.debug("Single step Flow Sequence : " + flowSequence);
+
+      return flowSequence;
+    }
+
+    if (localContext.getAttribute(GENERATION_NODE) != null) {
+      flowSequence = generationNode(localContext.getAttribute(GENERATION_NODE));
+    } else {
+      flowSequence = getFlowSequenceFromType(ctx, localContext, localContext.getAttribute(SEQUENCE_TYPE));
+    }
+    return flowSequence;
+  }
+
+  private String generationNode(String generationNode) throws Exception {
+    if (!transactionExecutor.hasGraph(MODULE, generationNode, null, "sync")) {
+      throw new Exception("Can not find Custom defined Flow Generator for " + generationNode);
+    }
+    return transactionExecutor
+        .executeGraph(MODULE, generationNode, null, "sync", null)
+        .getProperty(FLOW_SEQUENCE);
+  }
+
+  private String getFlowSequenceFromType(SvcLogicContext ctx, SvcLogicContext localContext,
+      String sequenceType) throws Exception {
+    String flowSequence;
+    String vnfType = ctx.getAttribute(VNF_TYPE);
+    if (sequenceType.equalsIgnoreCase(DESINGTIME)) {
+
+      localContext.setAttribute(VNFC_TYPE, ctx.getAttribute(VNFC_TYPE));
+      flowSequence = dbService.getDesignTimeFlowModel(localContext);
+
+      if (flowSequence == null) {
+        throw new Exception("Flow Sequence is not found User Designed VNF " + vnfType);
+      }
+    } else if (sequenceType.equalsIgnoreCase(RUNTIME)) {
+
+      Transaction transaction = inputParamsCollector.collectInputParams(ctx);
+      log.info("CollectInputParamsData-Input: " + transaction.getPayload());
+
+      Map<String, String> flowSeq = restExecutor.execute(transaction, localContext);
+
+      JSONObject output = new JSONObject(flowSeq.get("restResponse")).optJSONObject("output");
+      if (output == null) {
+        throw new Exception("Failed to get the Flow Sequence runtime for VNF type " + vnfType);
+      }
+      flowSequence = output.toString();
+      log.info("MultistepSequenceGenerator-Output: " + flowSequence);
+
+    } else if (sequenceType.equalsIgnoreCase(EXTERNAL)) {
+      //String input = collectInputParams(localContext);
+      //    flowSequnce = ""; //get it from the External interface calling the Rest End point - TBD
+      //if(flowSequnce == null)
+
+      throw new Exception("Flow Sequence not found for " + vnfType);
+
+    } else {
+      //No other type of model supported...
+      //in Future can get flowModel from other generators which will be included here
+      throw new Exception("No information found for sequence Owner Design-Time Vs Run-Time");
+    }
+    return flowSequence;
+  }
+
+}
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InputParamsCollector.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InputParamsCollector.java
new file mode 100644
index 0000000..1a7e2bc
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InputParamsCollector.java
@@ -0,0 +1,193 @@
+/*
+ * ============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.onap.appc.flow.controller.utils.FlowControllerConstants.ACTION_LEVEL;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.APPC_FLOW_CONTROLLER;
+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.SEQ_GENERATOR_PWD;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.SEQ_GENERATOR_UID;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.SEQ_GENERATOR_URL;
+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.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import java.util.function.Consumer;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.appc.flow.controller.data.Transaction;
+import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
+import org.onap.appc.flow.controller.interfaceData.ActionIdentifier;
+import org.onap.appc.flow.controller.interfaceData.Capabilities;
+import org.onap.appc.flow.controller.interfaceData.DependencyInfo;
+import org.onap.appc.flow.controller.interfaceData.Input;
+import org.onap.appc.flow.controller.interfaceData.InventoryInfo;
+import org.onap.appc.flow.controller.interfaceData.RequestInfo;
+import org.onap.appc.flow.controller.interfaceData.Vnfcs;
+import org.onap.appc.flow.controller.utils.EncryptionTool;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+
+class InputParamsCollector {
+
+  private static final EELFLogger log = EELFManager.getInstance().getLogger(InputParamsCollector.class);
+
+  private final EnvVariables envVariables;
+  private final FlowControlDBService dbService;
+
+  static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
+
+  InputParamsCollector() {
+    this.envVariables = new EnvVariables();
+    this.dbService = FlowControlDBService.initialise();
+  }
+
+  InputParamsCollector(EnvVariables envVariables, FlowControlDBService dbService) {
+    this.envVariables = envVariables;
+    this.dbService = dbService;
+  }
+
+  Transaction collectInputParams(SvcLogicContext ctx) throws Exception {
+
+    String fn = "FlowExecuteNode.collectInputParams";
+    Properties prop = loadProperties();
+    log.info("Loaded Properties " + prop.toString());
+
+    String vnfId = ctx.getAttribute(VNF_ID);
+    log.debug(fn + "vnfId :" + vnfId);
+
+    if (StringUtils.isBlank(vnfId)) {
+      throw new Exception("VnfId is missing");
+    }
+
+    String resourceUri = prop.getProperty(SEQ_GENERATOR_URL);
+    log.info(fn + "resourceUri= " + resourceUri);
+
+    String pass = EncryptionTool.getInstance().decrypt(prop.getProperty(SEQ_GENERATOR_PWD));
+
+    Transaction transaction = new Transaction();
+    transaction.setPayload(getInputData(ctx, fn, vnfId));
+    transaction.setExecutionRPC("POST");
+    transaction.setuId(prop.getProperty(SEQ_GENERATOR_UID));
+    transaction.setPswd(pass);
+    transaction.setExecutionEndPoint(resourceUri);
+
+    return transaction;
+  }
+
+  private String getInputData(SvcLogicContext ctx, String fn, String vnfId) throws IOException, SvcLogicException {
+    ActionIdentifier actionIdentifier = new ActionIdentifier();
+    log.debug("Enter ActionIdentifier");
+
+    applyIfNotBlank(vnfId, actionIdentifier::setVnfId);
+    applyIfNotBlank(ctx.getAttribute(VSERVER_ID), actionIdentifier::setVserverId);
+    applyIfNotBlank(ctx.getAttribute(VNFC_NAME), actionIdentifier::setVnfcName);
+
+    log.info("ActionIdentifierData" + actionIdentifier.toString());
+
+    log.info("Enter RequestInfo");
+    RequestInfo requestInfo = getRequestInfo(ctx, actionIdentifier);
+    log.debug("RequestInfo: " + requestInfo.toString());
+
+    InventoryInfo inventoryInfo = new InventoryInfoExtractor().getInventoryInfo(ctx, vnfId);
+    Capabilities capabilities = new CapabilitiesDataExtractor(dbService).getCapabilitiesData(ctx);
+    DependencyInfo dependencyInfo = getDependencyInfo(ctx);
+
+    log.info("Enter InputData");
+    Input input = getInput(requestInfo, inventoryInfo, dependencyInfo, capabilities);
+    log.info(fn + "Input parameters:" + input.toString());
+
+    ObjectMapper mapper = new ObjectMapper();
+    mapper.setSerializationInclusion(Include.NON_NULL);
+    mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+    String inputData = mapper.writeValueAsString(input);
+    log.info("InputDataJson:" + inputData);
+
+    return inputData;
+  }
+
+  private Input getInput(RequestInfo requestInfo, InventoryInfo inventoryInfo,
+      DependencyInfo dependencyInfo, Capabilities capabilities) {
+    Input input = new Input();
+    input.setRequestInfo(requestInfo);
+    input.setInventoryInfo(inventoryInfo);
+    input.setDependencyInfo(dependencyInfo);
+    input.setCapabilities(capabilities);
+    return input;
+  }
+
+  private RequestInfo getRequestInfo(SvcLogicContext ctx, ActionIdentifier actionIdentifier) {
+    RequestInfo requestInfo = new RequestInfo();
+    requestInfo.setAction(ctx.getAttribute(REQUEST_ACTION));
+    requestInfo.setActionLevel(ctx.getAttribute(ACTION_LEVEL));
+    requestInfo.setPayload(ctx.getAttribute(PAYLOAD));
+    requestInfo.setActionIdentifier(actionIdentifier);
+    return requestInfo;
+  }
+
+  DependencyInfo getDependencyInfo(SvcLogicContext ctx) throws SvcLogicException, IOException {
+
+    String fn = "FlowExecutorNode.getDependencyInfo";
+    String dependencyData = dbService.getDependencyInfo(ctx);
+    log.info(fn + "dependencyDataInput:" + dependencyData);
+
+    DependencyInfo dependencyInfo = new DependencyInfo();
+    if (dependencyData == null) {
+      return dependencyInfo;
+    }
+
+    ObjectMapper mapper = new ObjectMapper();
+    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+    mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+    //JsonNode dependencyInfoData = mapper.readTree(dependencyData).get("dependencyInfo");
+    JsonNode vnfcData = mapper.readTree(dependencyData).get("vnfcs");
+    dependencyInfo.getVnfcs().addAll(mapper.readValue(vnfcData.toString(), new TypeReference<List<Vnfcs>>(){}));
+
+    log.info("Dependency Output:" + dependencyInfo.toString());
+    return dependencyInfo;
+  }
+
+  private Properties loadProperties() throws Exception {
+    String directory = envVariables.getenv(SDNC_CONFIG_DIR_VAR);
+    if (directory == null) {
+      throw new Exception("Cannot find Property file -" + SDNC_CONFIG_DIR_VAR);
+    }
+    String path = directory + APPC_FLOW_CONTROLLER;
+    return PropertiesLoader.load(path);
+  }
+
+  private void applyIfNotBlank(String parameter, Consumer<String> consumer) {
+    if (StringUtils.isNotBlank(parameter)) {
+      consumer.accept(parameter);
+    }
+  }
+
+}
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.java
index 78d5305..038d35b 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.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.att.eelf.configuration.EELFLogger;
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/PropertiesLoader.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/PropertiesLoader.java
index 28792bb..854f476 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/PropertiesLoader.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/PropertiesLoader.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.FileInputStream;
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/ResourceUriExtractor.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/ResourceUriExtractor.java
index cd07952..c36a74b 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/ResourceUriExtractor.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/ResourceUriExtractor.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.onap.appc.flow.controller.utils.FlowControllerConstants.HTTP;
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/TransactionHandler.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/TransactionHandler.java
index af9e845..b4becd9 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/TransactionHandler.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/TransactionHandler.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.onap.appc.flow.controller.utils.FlowControllerConstants.INPUT_REQUEST_ACTION;
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
