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
new file mode 100644
index 0000000..6cc3b75
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/EnvVariables.java
@@ -0,0 +1,26 @@
+package org.onap.appc.flow.controller.node;
+
+import java.util.function.Function;
+
+/**
+ * Wrapper for accessing environment variables
+ */
+class EnvVariables {
+
+  private Function<String, String> envSupplier;
+
+  EnvVariables() {
+    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/JsonValidator.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.java
new file mode 100644
index 0000000..78d5305
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/JsonValidator.java
@@ -0,0 +1,29 @@
+package org.onap.appc.flow.controller.node;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.apache.commons.lang3.StringUtils;
+
+class JsonValidator {
+
+  private static final EELFLogger log = EELFManager.getInstance().getLogger(JsonValidator.class);
+
+  static JsonNode validate(String json) throws IOException {
+    if (StringUtils.isBlank(json)) {
+      return null;
+    }
+    JsonNode output = null;
+    try {
+      ObjectMapper objectMapper = new ObjectMapper();
+      output = objectMapper.readTree(json);
+    } catch (JsonProcessingException e) {
+      log.warn("Response received from interface is not a valid JSON block" + json, e);
+    }
+    return output;
+  }
+
+}
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 0745f20..cd07952 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
@@ -13,6 +13,7 @@
 import java.util.Properties;
 import org.apache.commons.lang.StringUtils;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 
 /**
  * Helper class for RestServiceNode
@@ -21,9 +22,7 @@
 
   private static final EELFLogger log = EELFManager.getInstance().getLogger(RestServiceNode.class);
 
-  private ResourceUriExtractor() {}
-
-  static String extractResourceUri(SvcLogicContext ctx, Properties prop) throws Exception {
+  String extractResourceUri(SvcLogicContext ctx, Properties prop) throws Exception {
     String resourceUri = ctx.getAttribute(INPUT_URL);
 
     if (StringUtils.isBlank(resourceUri)) {
@@ -38,34 +37,34 @@
     return resourceUri;
   }
 
-  private static String getAddress(SvcLogicContext ctx) {
+  private String getAddress(SvcLogicContext ctx) {
     String address = ctx.getAttribute(INPUT_HOST_IP_ADDRESS);
     String port = ctx.getAttribute(INPUT_PORT_NUMBER);
     return HTTP + address + ":" + port;
   }
 
-  private static String getContext(SvcLogicContext ctx, Properties prop) {
+  private String getContext(SvcLogicContext ctx, Properties prop) throws Exception {
     String context;
     if (StringUtils.isNotBlank(ctx.getAttribute(INPUT_CONTEXT))) {
       context = "/" + ctx.getAttribute(INPUT_CONTEXT);
     } else if (prop.getProperty(ctx.getAttribute(INPUT_REQUEST_ACTION) + ".context") != null) {
       context = "/" + prop.getProperty(ctx.getAttribute(INPUT_REQUEST_ACTION) + ".context");
     } else {
-      throw new IllegalArgumentException("Could Not found the context for operation " + ctx.getAttribute(INPUT_REQUEST_ACTION));
+      throw new Exception("Could Not found the context for operation " + ctx.getAttribute(INPUT_REQUEST_ACTION));
     }
     return context;
   }
 
-  private static String getSubContext(SvcLogicContext ctx, Properties prop) {
+  private String getSubContext(SvcLogicContext ctx, Properties prop) throws Exception {
     String subContext;
     if (StringUtils.isNotBlank(ctx.getAttribute(INPUT_SUB_CONTEXT))) {
       subContext = "/" + ctx.getAttribute(INPUT_SUB_CONTEXT);
     } else if (prop.getProperty(ctx.getAttribute(INPUT_REQUEST_ACTION) + ".sub-context") != null) {
       subContext = "/" + prop.getProperty(ctx.getAttribute(INPUT_REQUEST_ACTION) + ".sub-context");
     } else {
-      throw new IllegalArgumentException("Could Not found the sub context for operation " + ctx.getAttribute(INPUT_REQUEST_ACTION));
+      throw new Exception("Could Not found the sub context for operation " + ctx.getAttribute(INPUT_REQUEST_ACTION));
     }
     return subContext;
   }
 
-}
+}
\ No newline at end of file
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/RestServiceNode.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/RestServiceNode.java
index 3597e0d..184ba3b 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/RestServiceNode.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/RestServiceNode.java
@@ -32,10 +32,7 @@
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
 import java.util.Map;
 import java.util.Properties;
 import org.apache.commons.lang3.StringUtils;
@@ -50,6 +47,31 @@
   private static final EELFLogger log = EELFManager.getInstance().getLogger(RestServiceNode.class);
   private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
 
+  static final String REST_RESPONSE = "restResponse";
+
+  private final TransactionHandler transactionHandler;
+  private final RestExecutor restExecutor;
+  private final ResourceUriExtractor resourceUriExtractor;
+  private final EnvVariables envVariables;
+
+  public RestServiceNode() {
+    this.transactionHandler = new TransactionHandler();
+    this.restExecutor = new RestExecutor();
+    this.resourceUriExtractor = new ResourceUriExtractor();
+    this.envVariables = new EnvVariables();
+  }
+
+  /**
+   * Constructor for tests, prefer to use no arg constructor
+   */
+  RestServiceNode(TransactionHandler transactionHandler, RestExecutor restExecutor,
+      ResourceUriExtractor uriExtractor, EnvVariables envVariables) {
+    this.transactionHandler = transactionHandler;
+    this.restExecutor = restExecutor;
+    this.resourceUriExtractor = uriExtractor;
+    this.envVariables = envVariables;
+  }
+
   public void sendRequest(Map<String, String> inParams, SvcLogicContext ctx)
       throws SvcLogicException {
     String fn = "RestServiceNode.sendRequest";
@@ -58,13 +80,30 @@
     try {
       responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
       //Remove below for Block
-      for (Object key : ctx.getAttributeKeySet()) {
-        String parmName = (String) key;
-        String parmValue = ctx.getAttribute(parmName);
-        log.info(fn + "Getting Key = " + parmName + "and Value = " + parmValue);
+      for (String key : ctx.getAttributeKeySet()) {
+        log.info(fn + "Getting Key = " + key + "and Value = " + ctx.getAttribute(key));
       }
 
-      send(ctx, inParams);
+      Properties prop = loadProperties();
+      log.info("Loaded Properties " + prop.toString());
+
+      String resourceUri = resourceUriExtractor.extractResourceUri(ctx, prop);
+
+      log.info("Rest Constructed URL : " + resourceUri);
+
+      Transaction transaction = transactionHandler.buildTransaction(ctx, prop, resourceUri);
+      Map<String, String> output = restExecutor.execute(transaction, ctx);
+
+      String json = output.get(REST_RESPONSE);
+      log.info("Received response from Interface " + json);
+
+      JsonNode validatedJson = JsonValidator.validate(json);
+
+      if (validatedJson != null) {
+        log.info("state is " + validatedJson.findValue("state"));
+        ctx.setAttribute(responsePrefix + OUTPUT_STATUS_MESSAGE, output.get(REST_RESPONSE));
+      }
+
       ctx.setAttribute(responsePrefix + OUTPUT_PARAM_STATUS, OUTPUT_STATUS_SUCCESS);
 
     } catch (Exception e) {
@@ -75,67 +114,12 @@
     }
   }
 
-  private void send(SvcLogicContext ctx, Map<String, String> inParams) throws Exception {
-    try {
-      Properties prop = loadProperties();
-      log.info("Loaded Properties " + prop.toString());
-      String responsePrefix = inParams.get(INPUT_PARAM_RESPONSE_PREFIX);
-      String resourceUri = ResourceUriExtractor.extractResourceUri(ctx, prop);
-      log.info("Rest Constructed URL : " + resourceUri);
-
-      Transaction transaction = TransactionHandler.buildTransaction(ctx, prop, resourceUri);
-
-      RestExecutor restRequestExecutor = new RestExecutor();
-      Map<String, String> output = restRequestExecutor.execute(transaction, ctx);
-
-      if (isValidJson(output.get("restResponse")) != null) {
-        ctx.setAttribute(responsePrefix + "." + OUTPUT_STATUS_MESSAGE,
-            output.get("restResponse"));
-//                JsonNode restResponse = isValidJson(output.get("restResponse"));
-//                for (String key : inParams.keySet()) {
-//                    if(key !=null &&  key.startsWith("output-")){
-//                            log.info("Found Key = " + key);
-//                            log.info("Found Key in Params " + inParams.get(key) + ".");
-//                            JsonNode setValue =  restResponse.findValue(inParams.get(key));                            
-//                             log.info("Found value = " + setValue);
-//                             if(setValue !=null && setValue.textValue() !=null && !setValue.textValue().isEmpty())
-//                                 ctx.setAttribute(responsePrefix + "." + key, setValue.textValue());
-//                             else
-//                                 ctx.setAttribute(responsePrefix + "." + key, null);
-//                    }
-//                }                
-      }
-      log.info("Response from Rest :");
-
-    } catch (Exception e) {
-      log.error("Error Message: " + e.getMessage(), e);
-      throw e;
-    }
-  }
-
   private Properties loadProperties() throws Exception {
-    String directory = System.getenv(SDNC_CONFIG_DIR_VAR);
+    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 JsonNode isValidJson(String json) throws IOException {
-    JsonNode output;
-    log.info("Received response from Interface " + json);
-    if (json == null || json.isEmpty()) {
-      return null;
-    }
-    try {
-      ObjectMapper objectMapper = new ObjectMapper();
-      output = objectMapper.readTree(json);
-    } catch (JsonProcessingException e) {
-      log.warn("Response received from interface is not a valid JSON block" + json, e);
-      return null;
-    }
-    log.info("state is " + output.findValue("state"));
-    return output;
-  }
 }
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 8d10b3c..af9e845 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
@@ -13,20 +13,17 @@
  */
 class TransactionHandler {
 
-  private TransactionHandler() {}
-
-  static Transaction buildTransaction(SvcLogicContext ctx, Properties prop,
-      String resourceUri) throws Exception {
+  Transaction buildTransaction(SvcLogicContext ctx, Properties prop, String resourceUri)
+      throws Exception {
 
     String inputRequestAction = ctx.getAttribute(INPUT_REQUEST_ACTION);
     String inputRequestActionType = ctx.getAttribute(INPUT_REQUEST_ACTION_TYPE);
 
     if (StringUtils.isBlank(inputRequestActionType)) {
-      throw new IllegalArgumentException(
-          "Don't know REST operation for Action " + inputRequestActionType);
+      throw new Exception("Don't know REST operation for Action " + inputRequestActionType);
     }
     if (StringUtils.isBlank(inputRequestAction)) {
-      throw new IllegalArgumentException("Don't know request-action " + INPUT_REQUEST_ACTION);
+      throw new Exception("Don't know request-action " + INPUT_REQUEST_ACTION);
     }
 
     Transaction transaction = new Transaction();
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
new file mode 100644
index 0000000..fd6f920
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/JsonValidatorTest.java
@@ -0,0 +1,36 @@
+package org.onap.appc.flow.controller.node;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import java.io.IOException;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class JsonValidatorTest {
+
+  @Test
+  public void should_return_json_node_on_valid_json() throws IOException {
+    String json = "{'test': 'OK'}".replaceAll("'", "\"");
+    JsonNode result = JsonValidator.validate(json);
+
+    Assert.assertNotNull(result);
+    Assert.assertTrue(result.has("test"));
+    Assert.assertEquals("OK", result.get("test").asText());
+  }
+
+  @Test
+  public void should_return_null_on_empty_input() throws IOException {
+    String json = "";
+    JsonNode result = JsonValidator.validate(json);
+
+    Assert.assertNull(result);
+  }
+
+  @Test
+  public void should_return_null_on_invalid_input() throws IOException {
+    String json = "{'test': 'OK'".replaceAll("'", "\"");
+    JsonNode result = JsonValidator.validate(json);
+
+    Assert.assertNull(result);
+  }
+
+}
\ No newline at end of file
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 06f86c5..28a202c 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
@@ -24,21 +24,24 @@
 
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
+  private ResourceUriExtractor resourceUriExtractor;
 
   @Before
   public void setUp() {
     ctx = mock(SvcLogicContext.class);
     prop = mock(Properties.class);
+    resourceUriExtractor = new ResourceUriExtractor();
   }
 
   @Test
   public void should_return_input_url_if_exist() throws Exception {
     ctx = mock(SvcLogicContext.class);
-    when(ctx.getAttribute(INPUT_URL)).thenReturn("test resource uri");
+    when(ctx.getAttribute(INPUT_URL)).thenReturn("http://localhost:8080");
 
-    String resourceUri = ResourceUriExtractor.extractResourceUri(ctx, prop);
+    resourceUriExtractor = new ResourceUriExtractor();
+    String resourceUri = resourceUriExtractor.extractResourceUri(ctx, prop);
 
-    Assert.assertEquals("test resource uri", resourceUri);
+    Assert.assertEquals("http://localhost:8080", resourceUri);
   }
 
   @Test
@@ -50,7 +53,7 @@
     when(ctx.getAttribute(INPUT_CONTEXT)).thenReturn("input-context");
     when(ctx.getAttribute(INPUT_SUB_CONTEXT)).thenReturn("input-sub-context");
 
-    String resourceUri = ResourceUriExtractor.extractResourceUri(ctx, prop);
+    String resourceUri = resourceUriExtractor.extractResourceUri(ctx, prop);
 
     Assert.assertEquals("http://localhost:8080/input-context/input-sub-context", resourceUri);
   }
@@ -68,7 +71,7 @@
     when(prop.getProperty("request-action.context")).thenReturn("ra-context");
     when(prop.getProperty("request-action.sub-context")).thenReturn("ra-sub-context");
 
-    String resourceUri = ResourceUriExtractor.extractResourceUri(ctx, prop);
+    String resourceUri = resourceUriExtractor.extractResourceUri(ctx, prop);
 
     Assert.assertEquals("http://localhost:8080/ra-context/ra-sub-context", resourceUri);
   }
@@ -82,7 +85,7 @@
     expectedException.expect(Exception.class);
     expectedException.expectMessage("Could Not found the context for operation null");
 
-    ResourceUriExtractor.extractResourceUri(ctx, prop);
+    resourceUriExtractor.extractResourceUri(ctx, prop);
   }
 
 }
\ No newline at end of file
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 a6a207d..20a1fd3 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
@@ -1,4 +1,3 @@
-
 /*-
  * ============LICENSE_START=======================================================
  * ONAP : APPC
@@ -22,56 +21,169 @@
  */
 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.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+import static org.onap.appc.flow.controller.node.RestServiceNode.REST_RESPONSE;
+import static org.onap.appc.flow.controller.utils.FlowControllerConstants.INPUT_PARAM_RESPONSE_PREFIX;
+
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Properties;
+import org.junit.Before;
+import org.junit.Ignore;
+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.executorImpl.RestExecutor;
 import org.onap.appc.flow.controller.utils.FlowControllerConstants;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 
 public class TestRestServiceNode {
 
-    @Test(expected=Exception.class)
-    public void testRestServiceNode() throws Exception {
+  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' }";
 
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute(FlowControllerConstants.VNF_TYPE, "vUSP - vDBE-IPX HUB");
-        ctx.setAttribute(FlowControllerConstants.REQUEST_ACTION, "healthcheck");
-        ctx.setAttribute(FlowControllerConstants.VNFC_TYPE, "TESTVNFC-CF");
-        ctx.setAttribute(FlowControllerConstants.REQUEST_ID,"TESTCOMMONFRMWK");
-        ctx.setAttribute("host-ip-address","127.0.0.1");
-        ctx.setAttribute("port-number","8888");
-        ctx.setAttribute("request-action-type","GET");
-        ctx.setAttribute("context", "loader/restconf/operations/appc-provider-lcm:health-check");
+  private RestServiceNode restServiceNode;
 
-        HashMap<String, String> inParams = new HashMap<String, String>();
-        RestServiceNode rsn = new RestServiceNode();
-        inParams.put("output-state", "state");
-        inParams.put("responsePrefix", "healthcheck");
-        rsn.sendRequest(inParams, ctx);
+  private ResourceUriExtractor uriExtractorMock;
+  private TransactionHandler transactionHandlerMock;
+  private RestExecutor restExecutorMock;
 
-        for (Object key : ctx.getAttributeKeySet()) {
-            String parmName = (String) key;
-            String parmValue = ctx.getAttribute(parmName);
-        }
+  private SvcLogicContext ctxMock;
+  private Transaction transaction;
+  private Map<String, String> params;
 
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
 
+  @Before
+  public void setUp() throws Exception {
+
+    uriExtractorMock = mock(ResourceUriExtractor.class);
+    transactionHandlerMock = mock(TransactionHandler.class);
+    restExecutorMock = mock(RestExecutor.class);
+    ctxMock = mock(SvcLogicContext.class);
+    transaction = mock(Transaction.class);
+
+    // given
+    params = new HashMap<>();
+
+    HashMap<String, String> restResponseMap = new HashMap<>();
+    restResponseMap.put(REST_RESPONSE, REST_BODY_RESPONSE.replaceAll("'", "\""));
+
+    when(uriExtractorMock
+        .extractResourceUri(any(SvcLogicContext.class), any(Properties.class)))
+        .thenReturn(RESOURCE_URI);
+    when(transactionHandlerMock
+        .buildTransaction(any(SvcLogicContext.class), any(Properties.class), eq(RESOURCE_URI)))
+        .thenReturn(transaction);
+    when(restExecutorMock.execute(eq(transaction), any(SvcLogicContext.class)))
+        .thenReturn(restResponseMap);
+
+    EnvVariables envVariables = new EnvVariables(envKey -> MOCK_ENV);
+    restServiceNode = new RestServiceNode(transactionHandlerMock, restExecutorMock, uriExtractorMock, envVariables);
+  }
+
+  @Test
+  public void should_send_request() throws Exception {
+    // given
+    params.put(INPUT_PARAM_RESPONSE_PREFIX, "some-prefix");
+
+    // when
+    restServiceNode.sendRequest(params, ctxMock);
+
+    // then
+    verify(uriExtractorMock)
+        .extractResourceUri(eq(ctxMock), any(Properties.class));
+    verify(transactionHandlerMock)
+        .buildTransaction(eq(ctxMock), any(Properties.class), eq(RESOURCE_URI));
+    verify(restExecutorMock)
+        .execute(transaction, ctxMock);
+    verifyNoMoreInteractions(uriExtractorMock, transactionHandlerMock, restExecutorMock);
+  }
+
+  @Test
+  public void should_rethrow_exception_from_uri_extractor() throws Exception {
+    when(uriExtractorMock
+        .extractResourceUri(eq(ctxMock), any(Properties.class)))
+        .thenThrow(new Exception("resource uri exception"));
+
+    expectedException.expect(SvcLogicException.class);
+    expectedException.expectMessage("resource uri exception");
+
+    restServiceNode.sendRequest(params, ctxMock);
+  }
+
+  @Test
+  public void should_rethrow_exception_from_transaction_handler() throws Exception {
+    when(transactionHandlerMock
+        .buildTransaction(eq(ctxMock), any(Properties.class), eq(RESOURCE_URI)))
+        .thenThrow(new Exception("transaction exception"));
+
+    expectedException.expect(SvcLogicException.class);
+    expectedException.expectMessage("transaction exception");
+
+    restServiceNode.sendRequest(params, ctxMock);
+  }
+
+  @Test
+  public void should_rethrow_exception_from_rest_executor() throws Exception {
+    when(restExecutorMock
+        .execute(transaction, ctxMock))
+        .thenThrow(new Exception("rest executor exception"));
+
+    expectedException.expect(SvcLogicException.class);
+    expectedException.expectMessage("rest executor exception");
+
+    restServiceNode.sendRequest(params, ctxMock);
+  }
+
+  @Ignore("missing asserts")
+  @Test(expected = Exception.class)
+  public void testRestServiceNode() throws Exception {
+
+    SvcLogicContext ctx = new SvcLogicContext();
+    ctx.setAttribute(FlowControllerConstants.VNF_TYPE, "vUSP - vDBE-IPX HUB");
+    ctx.setAttribute(FlowControllerConstants.REQUEST_ACTION, "healthcheck");
+    ctx.setAttribute(FlowControllerConstants.VNFC_TYPE, "TESTVNFC-CF");
+    ctx.setAttribute(FlowControllerConstants.REQUEST_ID, "TESTCOMMONFRMWK");
+    ctx.setAttribute("host-ip-address", "127.0.0.1");
+    ctx.setAttribute("port-number", "8888");
+    ctx.setAttribute("request-action-type", "GET");
+    ctx.setAttribute("context", "loader/restconf/operations/appc-provider-lcm:health-check");
+
+    HashMap<String, String> inParams = new HashMap<String, String>();
+    RestServiceNode rsn = new RestServiceNode();
+    inParams.put("output-state", "state");
+    inParams.put("responsePrefix", "healthcheck");
+    rsn.sendRequest(inParams, ctx);
+
+    for (Object key : ctx.getAttributeKeySet()) {
+      String parmName = (String) key;
+      String parmValue = ctx.getAttribute(parmName);
     }
+  }
 
+  @Ignore("missing asserts")
+  @Test(expected = Exception.class)
+  public void testInputParamsRestServiceNode() throws Exception {
+    SvcLogicContext ctx = new SvcLogicContext();
+    ctx.setAttribute("vnf-id", "test");
+    ctx.setAttribute("tmp.vnfInfo.vm-count", "1");
+    ctx.setAttribute("tmp.vnfInfo.vm[0].vnfc-count", "1");
+    RestExecutor restExe = new RestExecutor();
+    Transaction transaction = new Transaction();
 
-    @Test(expected=Exception.class)
-    public void testInputParamsRestServiceNode() throws Exception {
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("vnf-id", "test");
-        ctx.setAttribute("tmp.vnfInfo.vm-count", "1");
-        ctx.setAttribute("tmp.vnfInfo.vm[0].vnfc-count", "1");
-        RestExecutor restExe = new RestExecutor();
-        Transaction transaction = new Transaction();
+    FlowControlNode node = new FlowControlNode();
+    Map<String, String> flowSeq = restExe.execute(transaction, ctx);
+    String flowSequnce = flowSeq.get("restResponse");
 
-        FlowControlNode node = new FlowControlNode();
-        Map<String,String> flowSeq= restExe.execute(transaction, ctx);
-        String flowSequnce=flowSeq.get("restResponse");
-
-    }
+  }
 }
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 5cdb062..f16dd65 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
@@ -18,6 +18,7 @@
 
   private static final String RESOURCE_URI = "some uri";
 
+  private TransactionHandler transactionHandler;
   private SvcLogicContext ctx;
   private Properties prop;
 
@@ -26,6 +27,7 @@
 
   @Before
   public void setUp() {
+    transactionHandler = new TransactionHandler();
     ctx = mock(SvcLogicContext.class);
     prop = mock(Properties.class);
   }
@@ -35,9 +37,10 @@
 
     when(ctx.getAttribute(INPUT_REQUEST_ACTION_TYPE)).thenReturn("");
 
-    expectedException.expect(IllegalArgumentException.class);
+    expectedException.expect(Exception.class);
     expectedException.expectMessage("Don't know REST operation for Action");
-    TransactionHandler.buildTransaction(ctx, prop, RESOURCE_URI);
+    transactionHandler = new TransactionHandler();
+    transactionHandler.buildTransaction(ctx, prop, RESOURCE_URI);
   }
 
   @Test
@@ -45,9 +48,9 @@
 
     when(ctx.getAttribute(INPUT_REQUEST_ACTION_TYPE)).thenReturn("foo");
 
-    expectedException.expect(IllegalArgumentException.class);
+    expectedException.expect(Exception.class);
     expectedException.expectMessage("Don't know request-action request-action");
-    TransactionHandler.buildTransaction(ctx, prop, "some uri");
+    transactionHandler.buildTransaction(ctx, prop, "some uri");
   }
 
   @Test
@@ -61,7 +64,7 @@
     when(prop.getProperty(ctx.getAttribute(INPUT_REQUEST_ACTION).concat(".default-rest-pass")))
         .thenReturn("rest-pass");
 
-    Transaction transaction = TransactionHandler.buildTransaction(ctx, prop, "some uri");
+    Transaction transaction = transactionHandler.buildTransaction(ctx, prop, "some uri");
 
     Assert.assertEquals(INPUT_REQUEST_ACTION, transaction.getAction());
     Assert.assertEquals("input-ra-type", transaction.getExecutionRPC());
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
new file mode 100644
index 0000000..0bbe7f2
--- /dev/null
+++ b/appc-config/appc-flow-controller/provider/src/test/resources/appc-flow-controller.properties
@@ -0,0 +1,25 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : APP-C
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+# test properties used by RestServiceNode
+
+healthcheck.mock=false
+healthcheck.default-rest-user=User
+healthcheck.default-rest-pass=@#asd723%^
