diff --git a/adapters/mso-vfc-adapter/pom.xml b/adapters/mso-vfc-adapter/pom.xml
index 4f049c3..7cb8eea 100644
--- a/adapters/mso-vfc-adapter/pom.xml
+++ b/adapters/mso-vfc-adapter/pom.xml
@@ -33,13 +33,18 @@
 	</build>
 
 	<dependencies>
-		<dependency>
+		<!--<dependency>
 			<groupId>javax</groupId>
 			<artifactId>javaee-web-api</artifactId>
 			<version>6.0</version>
 			<scope>provided</scope>
-		</dependency>
+		</dependency>-->
 		<dependency>
+    <groupId>javax.ws.rs</groupId>
+    <artifactId>javax.ws.rs-api</artifactId>
+    <version>2.0</version>
+</dependency>
+        <dependency>
 			<groupId>org.openecomp.so.adapters</groupId>
 			<artifactId>mso-adapter-utils</artifactId>
 			<version>${project.version}</version>
@@ -83,6 +88,10 @@
 			<artifactId>mso-requests-db</artifactId>
 			<version>${project.version}</version>
 		</dependency>
+        <dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+		</dependency>
 		<dependency>
             <groupId>org.jmockit</groupId>
             <artifactId>jmockit</artifactId>
@@ -101,5 +110,16 @@
             <version>1.19</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+    <groupId>org.glassfish.jersey.core</groupId>
+    <artifactId>jersey-common</artifactId>
+    <version>2.22.2</version>
+    <scope>test</scope>
+</dependency>
+        <dependency> 
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.1.0</version>
+        </dependency>            
 	</dependencies>
 </project>
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
index 1be5bab..438393b 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.mso.adapters.vfc;
 
 import javax.servlet.http.HttpServletRequest;
@@ -29,6 +30,7 @@
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 
+import org.openecomp.mso.adapters.vfc.exceptions.ApplicationException;
 import org.openecomp.mso.adapters.vfc.model.NSResourceInputParameter;
 import org.openecomp.mso.adapters.vfc.model.NsOperationKey;
 import org.openecomp.mso.adapters.vfc.model.RestfulResponse;
@@ -44,7 +46,7 @@
  * </p>
  * 
  * @author
- * @version     ONAP Amsterdam Release  2017-08-28
+ * @version ONAP Amsterdam Release 2017-08-28
  */
 @Path("/v1/vfcdrivers")
 public class VfcAdapterRest {
@@ -53,6 +55,10 @@
 
     private final VfcManager driverMgr = new VfcManager();
 
+    public VfcAdapterRest() {
+
+    }
+
     /**
      * Create a NS
      * <br>
@@ -67,12 +73,16 @@
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response createNfvoNs(HttpServletRequest servletReq) {
         // Step 1: get parameters from request for current node
-        String body = RestfulUtil.getRequestBody(servletReq);
-        ValidateUtil.assertObjectNotNull(body);
-        LOGGER.debug("body from request is {}" + body);
-        NSResourceInputParameter nsInput = JsonUtil.unMarshal(body, NSResourceInputParameter.class);
-        RestfulResponse rsp = driverMgr.createNs(nsInput);
-        return buildResponse(rsp);
+        try {
+            String body = RestfulUtil.getRequestBody(servletReq);
+            ValidateUtil.assertObjectNotNull(body);
+            LOGGER.debug("body from request is {}" + body);
+            NSResourceInputParameter nsInput = JsonUtil.unMarshal(body, NSResourceInputParameter.class);
+            RestfulResponse rsp = driverMgr.createNs(nsInput);
+            return buildResponse(rsp);
+        } catch(ApplicationException e) {
+            return e.buildErrorResponse();
+        }
     }
 
     /**
@@ -87,14 +97,17 @@
     @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response deleteNfvoNs(HttpServletRequest servletReq, @PathParam("nsInstanceId") String nsInstanceId) {
-        // Step 1: get parameters from request for current node
-        String body = RestfulUtil.getRequestBody(servletReq);
-        ValidateUtil.assertObjectNotNull(body);
-        LOGGER.debug("body from request is {}" + body);
-        NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
-
-        RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
-        return buildResponse(rsp);
+        try {
+            // Step 1: get parameters from request for current node
+            String body = RestfulUtil.getRequestBody(servletReq);
+            ValidateUtil.assertObjectNotNull(body);
+            LOGGER.debug("body from request is {}" + body);
+            NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
+            RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
+            return buildResponse(rsp);
+        } catch(ApplicationException e) {
+            return e.buildErrorResponse();
+        }
     }
 
     /**
@@ -102,7 +115,7 @@
      * <br>
      * 
      * @param servletReq The Http Request
-     * @param jobId The job id 
+     * @param jobId The job id
      * @return
      * @since ONAP Amsterdam Release
      */
@@ -111,15 +124,19 @@
     @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response queryNfvoJobStatus(HttpServletRequest servletReq, @PathParam("jobId") String jobId) {
-        ValidateUtil.assertObjectNotNull(jobId);
-        String body = RestfulUtil.getRequestBody(servletReq);
-        ValidateUtil.assertObjectNotNull(body);
-        LOGGER.debug("body from request is {}" + body);
-        NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
-        RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
-        return buildResponse(rsp);
-    }
+        try {
+            ValidateUtil.assertObjectNotNull(jobId);
+            String body = RestfulUtil.getRequestBody(servletReq);
+            ValidateUtil.assertObjectNotNull(body);
+            LOGGER.debug("body from request is {}" + body);
+            NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
 
+            RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
+            return buildResponse(rsp);
+        } catch(ApplicationException e) {
+            return e.buildErrorResponse();
+        }
+    }
 
     /**
      * Instantiate NS instance
@@ -136,11 +153,15 @@
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response instantiateNfvoNs(HttpServletRequest servletReq, @PathParam("nsInstanceId") String nsInstanceId) {
         String body = RestfulUtil.getRequestBody(servletReq);
-        ValidateUtil.assertObjectNotNull(body);
-        LOGGER.debug("body from request is {}" + body);
-        NSResourceInputParameter nsInput = JsonUtil.unMarshal(body, NSResourceInputParameter.class);
-        RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
-        return buildResponse(rsp);
+        try {
+            ValidateUtil.assertObjectNotNull(body);
+            LOGGER.debug("body from request is {}" + body);
+            NSResourceInputParameter nsInput = JsonUtil.unMarshal(body, NSResourceInputParameter.class);
+            RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
+            return buildResponse(rsp);
+        } catch(ApplicationException e) {
+            return e.buildErrorResponse();
+        }
     }
 
     /**
@@ -157,16 +178,19 @@
     @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response terminateNfvoNs(HttpServletRequest servletReq, @PathParam("nsInstanceId") String nsInstanceId) {
-        ValidateUtil.assertObjectNotNull(nsInstanceId);
-        String body = RestfulUtil.getRequestBody(servletReq);
-        ValidateUtil.assertObjectNotNull(body);
-        LOGGER.debug("body from request is {}" + body);
-        NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
-        RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
-        return buildResponse(rsp);
+        try {
+            ValidateUtil.assertObjectNotNull(nsInstanceId);
+            String body = RestfulUtil.getRequestBody(servletReq);
+            ValidateUtil.assertObjectNotNull(body);
+            LOGGER.debug("body from request is {}" + body);
+            NsOperationKey nsOperationKey = JsonUtil.unMarshal(body, NsOperationKey.class);
+            RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
+            return buildResponse(rsp);
+        } catch(ApplicationException e) {
+            return e.buildErrorResponse();
+        }
     }
 
-
     /**
      * build response from restful response
      * <br>
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
index 171949a..f463f5e 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
@@ -71,6 +71,9 @@
         nfvoUrlMap.put(Step.QUERY, CommonConstant.NFVO_QUERY_URL);
     }
 
+    public VfcManager(){
+        
+    }
     /**
      * create network service
      * <br>
@@ -79,7 +82,7 @@
      * @return
      * @since ONAP Amsterdam Release
      */
-    public RestfulResponse createNs(NSResourceInputParameter segInput) {
+    public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {
 
         // Step1: get service template by node type
         String nsdId = segInput.getNsOperationKey().getNodeTemplateId();
@@ -143,7 +146,7 @@
      * @return
      * @since ONAP Amsterdam Release
      */
-    public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId) {
+    public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId)  throws ApplicationException{
         LOGGER.info("delete ns -> begin");
         // Step1: prepare url and methodType
         String url = getUrl(nsInstanceId, CommonConstant.Step.DELETE);
@@ -190,7 +193,7 @@
      * @return
      * @since ONAP Amsterdam Release
      */
-    public RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput) {
+    public RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput)  throws ApplicationException{
         // Call the NFVO or SDNO service to instantiate service
         LOGGER.info("instantiate ns -> begin");
 
@@ -254,7 +257,7 @@
      * @return
      * @since ONAP Amsterdam Release
      */
-    public RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId) {
+    public RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException{
         // Step1: save segment operation info for delete process
         LOGGER.info("save segment operation for delete process");
         ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus(nsOperationKey.getServiceId(),
@@ -319,7 +322,7 @@
      * @return
      * @since ONAP Amsterdam Release
      */
-    public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) {
+    public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId)  throws ApplicationException{
 
         ValidateUtil.assertObjectNotNull(jobId);
         // Step 1: query the current resource operation status
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
index 6a78d2e..61966d0 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
@@ -17,19 +17,22 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.mso.adapters.vfc.exceptions;
 
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response;;
 
-public class ApplicationException extends WebApplicationException {
+public class ApplicationException extends Exception {
 
     /**
      * Serial number.
      */
     private static final long serialVersionUID = 1L;
 
+    private int errorCode;
+
+    private String errorMsg;
+
     /**
      * Constructor<br/>
      * <p>
@@ -37,9 +40,37 @@
      * 
      * @param errorCode error status
      * @param errorDetail error detail
-     * @since  ONAP Amsterdam Release 2017-9-6
+     * @since ONAP Amsterdam Release 2017-9-6
      */
-    public ApplicationException(int errorCode, Object errorDetail) {
-        super(Response.status(errorCode).entity(errorDetail).type(MediaType.APPLICATION_JSON).build());
+    public ApplicationException(int errorCode, String errorMsg) {
+        this.errorCode = errorCode;
+        this.errorMsg = errorMsg;
+    }
+
+    public int getErrorCode() {
+        return errorCode;
+    }
+
+    public void setErrorCode(int errorCode) {
+        this.errorCode = errorCode;
+    }
+
+    public String getErrorMsg() {
+        return errorMsg;
+    }
+
+    public void setErrorMsg(String errorMsg) {
+        this.errorMsg = errorMsg;
+    }
+
+    /**
+     * build error Response
+     * <br>
+     * 
+     * @return
+     * @since ONAP Amsterdam Release
+     */
+    public Response buildErrorResponse() {
+        return Response.status(errorCode).entity(errorMsg).build();
     }
 }
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
index 34beb02..a9546d5 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.mso.adapters.vfc.util;
 
 import java.io.IOException;
@@ -29,7 +30,6 @@
 import org.openecomp.mso.logger.MessageEnum;
 import org.openecomp.mso.logger.MsoLogger;
 
-
 /**
  * Interface for json analyzing.<br/>
  * <p>
@@ -43,7 +43,7 @@
     /**
      * Log service
      */
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
 
     /**
      * Mapper.
@@ -75,11 +75,12 @@
      * @return model object
      * @since ONAP Amsterdam Release 2017-9-6
      */
-    public static <T> T unMarshal(String jsonstr, Class<T> type) {
+    public static <T> T unMarshal(String jsonstr, Class<T> type) throws ApplicationException {
         try {
             return MAPPER.readValue(jsonstr, type);
         } catch(IOException e) {
-        	LOGGER.error(MessageEnum.RA_NS_EXC, "","", MsoLogger.ErrorCode.BusinessProcesssError, "fail to unMarshal json", e);
+            LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+                    "fail to unMarshal json", e);
             throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
         }
     }
@@ -92,11 +93,12 @@
      * @return model object
      * @since ONAP Amsterdam Release 2017-9-6
      */
-    public static <T> T unMarshal(String jsonstr, TypeReference<T> type) {
+    public static <T> T unMarshal(String jsonstr, TypeReference<T> type) throws ApplicationException {
         try {
             return MAPPER.readValue(jsonstr, type);
         } catch(IOException e) {
-            LOGGER.error(MessageEnum.RA_NS_EXC, "","", MsoLogger.ErrorCode.BusinessProcesssError, "fail to unMarshal json", e);
+            LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+                    "fail to unMarshal json", e);
             throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
         }
     }
@@ -108,11 +110,12 @@
      * @return json string
      * @since ONAP Amsterdam Release 2017-9-6
      */
-    public static String marshal(Object srcObj) {
+    public static String marshal(Object srcObj) throws ApplicationException {
         try {
             return MAPPER.writeValueAsString(srcObj);
         } catch(IOException e) {
-        	LOGGER.error(MessageEnum.RA_NS_EXC, "","", MsoLogger.ErrorCode.BusinessProcesssError, "fail to marshal json", e);
+            LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+                    "fail to marshal json", e);
             throw new ApplicationException(HttpCode.BAD_REQUEST, "srcObj marshal failed!");
         }
     }
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
index 37228c8..a6fa2d2 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.mso.adapters.vfc.util;
 
 import org.openecomp.mso.adapters.vfc.constant.HttpCode;
@@ -49,7 +50,7 @@
      * @param name of parameter
      * @since ONAP Amsterdam Release 2017-9-6
      */
-    public static void assertStringNotNull(String paramValue, String paramName) {
+    public static void assertStringNotNull(String paramValue, String paramName) throws ApplicationException {
         if(null != paramValue && !paramValue.isEmpty()) {
             return;
         }
@@ -64,7 +65,7 @@
      * @param object data object
      * @since ONAP Amsterdam Release 2017-9-6
      */
-    public static void assertObjectNotNull(Object object) {
+    public static void assertObjectNotNull(Object object) throws ApplicationException {
         if(null == object) {
             LOGGER.error("Object is null.");
             throw new ApplicationException(HttpCode.BAD_REQUEST, "Object is null.");
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
index 46ab134..4c316f3 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
@@ -17,17 +17,29 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.mso.adapters.vfc;
 
-
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mock;
+import org.openecomp.mso.adapters.vfc.constant.CommonConstant;
+import org.openecomp.mso.adapters.vfc.constant.HttpCode;
+import org.openecomp.mso.adapters.vfc.model.RestfulResponse;
 import org.openecomp.mso.adapters.vfc.util.RestfulUtil;
 import org.openecomp.mso.adapters.vfc.util.ValidateUtil;
-import org.openecomp.mso.db.catalog.CatalogDatabase;
+import org.openecomp.mso.requestsdb.RequestsDatabase;
+import org.openecomp.mso.requestsdb.ResourceOperationStatus;
 
+import mockit.Mock;
 import mockit.MockUp;
 
 /**
@@ -37,89 +49,150 @@
  * </p>
  * 
  * @author
- * @version     ONAP Amsterdam Release  2017-08-31
+ * @version ONAP Amsterdam Release 2017-08-31
  */
 public class VfcAdapterTest {
 
-    @Mock
-    private static CatalogDatabase db;
+    private VfcAdapterRest vfcAdapter = new VfcAdapterRest();
 
     /**
      * File path
      */
     private static final String FILE_PATH = "src/test/resources/json/";
 
-    @Test
-    public void createTest () {
-//        // get request
-//        mockGetRequestBody(FILE_PATH + "createNfvoNsReq.json");
-//        // get service template
-//        ServiceTemplate svcTmpl = new ServiceTemplate();
-//        svcTmpl.setId("id");
-//        svcTmpl.setServiceTemplateId("svcTmplId");
-//        new MockUp<CatalogProxyImpl>() {
-//            @Mock
-//            public ServiceTemplate getSvcTmplByNodeType(String nodeType, String domainHost){
-//                return svcTmpl;
-//            }
-//        };
-//        // get response
-//        RestfulResponse restRsp = new RestfulResponse();
-//        restRsp.setStatus(HttpStatus.SC_OK);
-//        restRsp.setResponseJson(getJsonString(FILE_PATH + "createNfvoNsRsp.json"));
-//        mockGetRestfulRsp(restRsp);
-//        // insert data
-//        new MockUp<ServiceSegmentDaoImpl>() {
-//            @Mock
-//            public void insertSegment(ServiceSegmentModel serviceSegment) {
-//                // do nothing
-//            }
-//            @Mock
-//            public void insertSegmentOper(ServiceSegmentOperation svcSegmentOper) {
-//                // do nothing
-//            }
-//        };
-//        Response rsp = impl.createNfvoNs(servletReq);
-//        JSONObject obj = JSONObject.fromObject(rsp.getEntity());
-//        Assert.assertEquals(null, "1", obj.getString("nsInstanceId"));
-    }
-
-    @Test
-    public void deleteTest () {
-        
-    }
-
-    @Test
-    public void instantiateTest () {
-
-    }
-
-    @Test
-    public void terminateTest () {
-        
-    }
-
-    @Test
-    public void queryJobTest () {
-
-    }
-    
     /**
-     * Mock to get request body.<br/>
+     * Mock the request body form a file
+     * <br>
      * 
-     * @param file json file path.
-     * @since ONAP Amsterdam Release 2017-9-6
+     * @param fileName
+     * @since ONAP Amsterdam Release
      */
-    private void mockGetRequestBody(final String file) {
+    private void mockRestfulUtil(String fileName) {
         new MockUp<RestfulUtil>() {
 
-//            @Mock
-//            public String getRequestBody(HttpServletRequest request) {
-//                return getJsonString(file);
-//            }
+            /**
+             * mock get request body
+             * <br>
+             * 
+             * @param request
+             * @return
+             * @since ONAP Amsterdam Release
+             */
+            @Mock
+            public String getRequestBody(HttpServletRequest request) {
+                return getJsonString(fileName);
+            }
+
+            /**
+             * mock get send method
+             * <br>
+             * 
+             * @param url
+             * @param methodType
+             * @param content
+             * @return
+             * @since ONAP Amsterdam Release
+             */
+            @Mock
+            public RestfulResponse send(String url, String methodType, String content) {
+                if(url.contains(CommonConstant.NFVO_CREATE_URL) && methodType.equals(CommonConstant.MethodType.POST)) {
+                    return getResponse("createNsRsp.json");
+                } else {
+                    return null;
+                }
+            }
         };
     }
-    
+
+    /**
+     * Mock the request body form a file
+     * <br>
+     * 
+     * @param fileName
+     * @since ONAP Amsterdam Release
+     */
+    private void mockRequestDatabase() {
+        new MockUp<RequestsDatabase>() {
+
+            /**
+             * mock get resource operation status
+             * <br>
+             * 
+             * @param request
+             * @return
+             * @since ONAP Amsterdam Release
+             */
+            @Mock
+            public ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId,
+                    String resourceTemplateUUID) {
+                ResourceOperationStatus resStatus = new ResourceOperationStatus();
+                resStatus.setServiceId("111");
+                resStatus.setOperationId("111");
+                return resStatus;
+            }
+
+            /**
+             * Mock update Res Oper Status
+             * <br>
+             * 
+             * @param operStatus
+             * @since ONAP Amsterdam Release
+             */
+            @Mock
+            public void updateResOperStatus(ResourceOperationStatus operStatus) {
+
+            }
+        };
+    }
+
+    /**
+     * Before executing UT, start mock requst database
+     * <br>
+     * 
+     * @since ONAP Amsterdam Release
+     */
+    @Before
+    public void start() {
+        mockRequestDatabase();
+    }
+
+    /**
+     * After executing UT, close session<br/>
+     * 
+     * @since ONAP Amsterdam Release
+     */
+    @After
+    public void stop() {
+
+    }
+
+    @Test
+    public void createTest() {
+        // get request
+        mockRestfulUtil(FILE_PATH + "createNsReq.json");
+        vfcAdapter.createNfvoNs(null);
+    }
+
+    @Test
+    public void deleteTest() {
+
+    }
+
+    @Test
+    public void instantiateTest() {
+
+    }
+
+    @Test
+    public void terminateTest() {
+
+    }
+
+    @Test
+    public void queryJobTest() {
+
+    }
+
     /**
      * Get json string from file.<br/>
      * 
@@ -128,19 +201,37 @@
      * @throws IOException when fail to read
      * @since ONAP Amsterdam Release 2017-9-6
      */
+    @SuppressWarnings("deprecation")
     private String getJsonString(final String file) {
         if(ValidateUtil.isStrEmpty(file)) {
             return "";
         }
 
         String json = null;
-//        try {
-//            FileInputStream fileStream = new FileInputStream(new File(file));
-//            json = IOUtils.toString(fileStream);
-//        } catch(Exception e) {
-//            Assert.fail(e.getMessage());
-//        }
-
+        try {
+            FileInputStream fileStream = new FileInputStream(new File(file));
+            json = IOUtils.toString(fileStream);
+        } catch(Exception e) {
+            Assert.fail(e.getMessage());
+        }
         return json;
     }
+
+    /**
+     * get the response from file
+     * <br>
+     * 
+     * @param fileName
+     * @return
+     * @since ONAP Amsterdam Release
+     */
+    private RestfulResponse getResponse(String fileName) {
+        RestfulResponse responseSuccess = new RestfulResponse();
+        responseSuccess.setStatus(HttpCode.RESPOND_OK);
+        if(null != fileName) {
+            String jsonStr = getJsonString(FILE_PATH + fileName);
+            responseSuccess.setResponseContent(jsonStr);
+        }
+        return responseSuccess;
+    }
 }
