diff --git a/appc-inbound/appc-design-services/provider/pom.xml b/appc-inbound/appc-design-services/provider/pom.xml
index 697111b..f34319b 100755
--- a/appc-inbound/appc-design-services/provider/pom.xml
+++ b/appc-inbound/appc-design-services/provider/pom.xml
@@ -5,6 +5,7 @@
   ================================================================================
   Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
   Copyright (C) 2017 Amdocs
+  Modification Copyright (C) 2018 IBM
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -52,8 +53,7 @@
     <dependencies>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <version>1.9.5</version>
+            <artifactId>mockito-core</artifactId>            
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -186,3 +186,4 @@
         </dependency>
     </dependencies>
 </project>
+
diff --git a/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDBService.java b/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDBService.java
deleted file mode 100644
index 071c4b2..0000000
--- a/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDBService.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * ================================================================================
- * Copyright (C) 2018 IBM
- * =============================================================================
- * 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.design.validator;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Properties;
-import org.apache.commons.io.FileUtils;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.onap.appc.design.dbervices.DbService;
-import org.onap.appc.design.dbervices.DesignDBService;
-import org.onap.appc.design.propertyServices.PropertyUpdateService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import junit.framework.Assert;
-import org.powermock.reflect.Whitebox;
-
-public class TestDBService {
-
-    private final org.slf4j.Logger logger = LoggerFactory.getLogger(TestDBService.class);
-
-    @Ignore("Test is taking 60 seconds")
-    @Test
-    public void testGetDesigns() {
-        try {
-            String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\" }";
-            DesignDBService dbservice = DesignDBService.initialise();
-            dbservice.execute("getDesigns", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testGetStatus() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService dbservice = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            dbservice.execute("getStatus", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testUploadArtifact() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService dbservice = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            dbservice.execute("uploadArtifact", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testGetArtifact() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("getArtifact", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testSetIncart() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"action-level\":\"VNf\",\"protocol\":\"Test\", \"inCart\":\"Y\",\"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("setInCart", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testSetProtocolReference() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"action-level\":\"VNf\",\"protocol\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("setProtocolReference", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testSetStatus() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("setStatus", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testGetArtifactReference() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("getArtifactReference", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Ignore("Test is taking 120 seconds")
-    @Test
-    public void testGetGuiReference() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            DbService db = new DbService();
-            Whitebox.invokeMethod(db, "getDbLibService");
-            design.execute("getGuiReference", payload, "1234");
-        } catch (Exception e) {
-        }
-    }
-
-    @Test
-    public void testPropertyUpdateService() {
-        PropertyUpdateService ps = new PropertyUpdateService();
-    }
-
-    @Test
-    public void testLinkstatusRelationShip() {        
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "linkstatusRelationShip", 1, 1, payload);
-        } catch (Exception e) {
-        }
-    }
-
-    @Test
-    public void testGetSDCReferenceID() {
-        
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "getSDCReferenceID", payload);
-        } catch (Exception e) {
-        }
-    }
-
-    @Test
-    public void testGetDataFromActionStatus() {        
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "getDataFromActionStatus", payload, "Test");
-        } catch (Exception e) {
-        }
-    }
-
-    @Test
-    public void testSetActionStatus() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "setActionStatus", payload, "Accepted");
-        } catch (Exception e) {
-        }
-    }
-        
-    @Test
-    public void testGetSDCArtifactIDbyRequestID() {
-        try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "getSDCArtifactIDbyRequestID", "0");
-        } catch (Exception e) {
-        }
-    }
-
-    @Test
-    public void testCreateArtifactTrackingRecord() {
-            try {
-            String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact"));
-            String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\":  "+ content + " } ";
-            DesignDBService design = DesignDBService.initialise();
-            Whitebox.invokeMethod(design, "createArtifactTrackingRecord",payload,"0",1,1);
-        } catch (Exception e) {
-        }
-    }
-    @Test
-    public void testGetAppcTimestampUTC() throws Exception {
-             String requestId = "1234";
-             DesignDBService design = DesignDBService.initialise();
-             String result =  Whitebox.invokeMethod(design, "getAppcTimestampUTC",requestId);
-             assertTrue(result.endsWith("Z"));
-    }
-
-}
diff --git a/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDesignDBServices.java b/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDesignDBServices.java
new file mode 100644
index 0000000..9841496
--- /dev/null
+++ b/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestDesignDBServices.java
@@ -0,0 +1,180 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 IBM
+ * =============================================================================
+ * 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.design.validator;
+
+import static org.junit.Assert.*;
+
+import java.sql.ResultSet;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import static org.mockito.Mockito.when;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.appc.design.dbervices.DbService;
+import org.onap.appc.design.dbervices.DesignDBService;
+import org.onap.appc.design.services.util.ArtifactHandlerClient;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.reflect.Whitebox;
+
+@RunWith(MockitoJUnitRunner.class)
+@PrepareForTest(DesignDBService.class)
+public class TestDesignDBServices {
+
+    private DesignDBService designDbService;
+
+    private DesignDBService spyDesign;
+
+    @Mock
+    private DbService dbservice;
+
+    @Mock
+    private ResultSet rs;
+
+    @Mock
+    private ArtifactHandlerClient artifactHandlerClient;
+
+    @Before
+    public void setUp() throws Exception {
+        Map<String, String> outputMessage = new HashMap<>();
+        designDbService = DesignDBService.initialise();
+        Whitebox.setInternalState(designDbService, "dbservice", dbservice);
+        // Whitebox.setInternalState(designDbService, "ac",
+        // artifactHandlerClient);
+        Mockito.doReturn(outputMessage).when(artifactHandlerClient).execute(Mockito.anyString(), Mockito.anyString());
+        when(dbservice.getDBData(Mockito.anyString(), Mockito.anyList())).thenReturn(rs);
+        when(rs.next()).thenReturn(true, true, false);
+        Mockito.doReturn(true).when(dbservice).updateDBData(Mockito.anyString(), Mockito.anyList());
+
+        spyDesign = Mockito.spy(designDbService);
+    }
+
+    @Test
+    public void testSetStatus() throws Exception {
+        String payload = "{\"userID\": \"1234\", \"vnf-type\" : \"DesigTest-VNF\",\"artifact_status\":\"TestArtifactStatus\",\"action_status\":\"TestAction\",\"vnfc-type\":\"TestVnfc\" }";
+        String json = Whitebox.invokeMethod(spyDesign, "setStatus", payload, "1234");
+        assertEquals(true, json.contains("1234"));
+    }
+
+    @Test
+    public void testGetDesigns() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"artifact_status\":\"TestArtifactStatus\",\"action_status\":\"TestAction\" }";
+        String result = Whitebox.invokeMethod(spyDesign, "getDesigns", payload, "1234");
+        assertEquals(true, result.contains("0000"));
+    }
+
+    @Test
+    public void testGetDesignsWithFilter() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"filter\":\"TestFilter\" }";
+        String result = Whitebox.invokeMethod(spyDesign, "getDesigns", payload, "1234");
+        assertEquals(true, result.contains("0000"));
+    }
+
+    @Test
+    public void testSetInCartr() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"inCart\":\"TestInCart\",\"vnfc-type\":\"TestVnfc\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "setInCart", payload, "1234");
+        assertEquals(true, result.contains("success"));
+    }
+
+    @Test
+    public void testSetProtocolReference() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"template\":\"TestTemplate\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "setProtocolReference", payload, "1234");
+        assertEquals(true, result.contains("success"));
+    }
+
+    @Ignore
+    @Test(expected = ExceptionInInitializerError.class)
+    public void TestUploadArtifact() throws Exception {
+        String payload = " { \"userID\": \"00000\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-contents\":  \"TestContents\"} ";
+        Whitebox.invokeMethod(spyDesign, "uploadArtifact", payload, "1234");
+    }
+
+    @Test
+    public void testLinkstatusRelationShip() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"template\":\"TestTemplate\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "linkstatusRelationShip", 0, 0, payload);
+        assertEquals(null, result);
+    }
+
+    @Test
+    public void testGetSDCReferenceID() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"artifact-type\" :\"DESIGNTOOL-TEST\", \"artifact-name\":\"DesignRestArtifact_reference\"}";
+        int result = Whitebox.invokeMethod(spyDesign, "getSDCReferenceID", payload);
+        assertEquals(0, result);
+    }
+
+    @Test
+    public void testgetDataFromActionStatus() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"artifact-type\" :\"DESIGNTOOL-TEST\", \"artifact-name\":\"DesignRestArtifact_reference\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "getDataFromActionStatus", payload, "Data");
+        assertEquals(null, result);
+    }
+
+    @Test
+    public void testsetActionStatus() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"template\":\"TestTemplate\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "setActionStatus", payload, "Status");
+        assertEquals(null, result);
+    }
+
+    @Test
+    public void testcreateArtifactTrackingRecord() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"technology\":\"TestTech\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"template\":\"TestTemplate\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "createArtifactTrackingRecord", payload, "1234", 0, 0);
+        assertEquals(null, result);
+    }
+
+    @Test
+    public void testgetSDCArtifactIDbyRequestID() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"artifact-type\" :\"DESIGNTOOL-TEST\", \"artifact-name\":\"DesignRestArtifact_reference\"}";
+        int result = Whitebox.invokeMethod(spyDesign, "getSDCArtifactIDbyRequestID", payload);
+        assertEquals(0, result);
+    }
+
+    @Test(expected = Exception.class)
+    public void testgetArtifact() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"artifact-type\" :\"DESIGNTOOL-TEST\", \"artifact-name\":\"DesignRestArtifact_reference\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "getArtifact", payload, "1234");
+    }
+
+    @Test
+    public void testgetStatus() throws Exception {
+        String payload = "{\"userID\": \"0000\", \"vnf-type\" : \"DesigTest-VNF\",\"action\":\"TestAction\",\"action-level\":\"TestLevel\",\"protocol\":\"TestProtocol\",\"vnfc-type\":\"TestVnfc\",\"artifact-type\" :\"DESIGNTOOL-TEST\", \"artifact-name\":\"DesignRestArtifact_reference\"}";
+        String result = Whitebox.invokeMethod(spyDesign, "getStatus", payload, "1234");
+        assertEquals(true, result.contains("0000"));
+    }
+
+    @Test
+    public void testGetAppcTimestampUTC() throws Exception {
+             String requestId = "1234";
+             DesignDBService design = DesignDBService.initialise();
+             String result =  Whitebox.invokeMethod(design, "getAppcTimestampUTC",requestId);
+             assertTrue(result.endsWith("Z"));
+    }
+}
\ No newline at end of file
diff --git a/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestRequestValidator.java b/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestRequestValidator.java
new file mode 100644
index 0000000..d5e54a5
--- /dev/null
+++ b/appc-inbound/appc-design-services/provider/src/test/java/org/onap/appc/design/validator/TestRequestValidator.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 IBM
+ * =============================================================================
+ * 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.design.validator;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.appc.design.dbervices.RequestValidator;
+import org.powermock.reflect.Whitebox;
+
+public class TestRequestValidator {
+
+    @Test
+    public void TestExecuteGetDesigns() throws Exception {
+        String action = "getDesigns";
+        String payload = "{\"userID\":\"0000\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test(expected = Exception.class)
+    public void TestExecuteGetArtifactException() throws Exception {
+        String action = "getArtifact";
+        String payload = "{\"userID\":\"0000\",\"vnf-type\":\"TestVnfType\",\"artifact-name\":\"TestArtifactName\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test
+    public void TestExecuteGetArtifact() throws Exception {
+        String action = "getArtifact";
+        String payload = "{\"userID\":\"0000\",\"vnf-type\":\"TestVnfType\",\"artifact-name\":\"TestArtifactName\",\"artifact-type\":\"TestArtifactType\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test
+    public void TestExecuteGetStatus() throws Exception {
+        String action = "getStatus";
+        String payload = "{\"userID\":\"0000\",\"vnf-type\":\"TestVnfType\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test
+    public void TestExecuteSetStatus() throws Exception {
+        String action = "setStatus";
+        String payload = "{\"userID\":\"0000\",\"vnf-type\":\"TestVnfType\",\"artifact-type\":\"TestArtifactType\",\"action\":\"TestAction\",\"status\":\"TestStatus\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test
+    public void TestExecuteUploadArtifact() throws Exception {
+        String action = "uploadArtifact";
+        String payload = "{\"artifact-name\":\"TestArtifactName\",\"vnf-type\":\"TestVnfType\",\"artifact-type\":\"TestArtifactType\",\"action\":\"TestAction\",\"artifact-version\":\"TestVersion\",\"artifact-contents\":\"TestContents\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+
+    @Test
+    public void TestExecuteSetInCart() throws Exception {
+        String action = "setInCart";
+        String payload = "{\"vnf-type\":\"TestVnfType\",\"action\":\"TestAction\",\"action-level\":\"TestActionLevel\",\"protocol\":\"TestProtocol\"}";
+        // RequestValidator.validate(action, payload);        
+        String s = Whitebox.invokeMethod(RequestValidator.class, "validate", action, payload);
+        assertEquals(null, s);
+    }
+}
