added test case to TestDGGeneralDBService.java 63/76263/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 24 Jan 2019 09:24:06 +0000 (14:54 +0530)
committerTakamune Cho <takamune.cho@att.com>
Thu, 24 Jan 2019 19:38:22 +0000 (19:38 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Icc459b97d2b15e204c3002a237752af9fe34cb20
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java

index e8c42b7..9780961 100644 (file)
@@ -319,4 +319,23 @@ public class TestDGGeneralDBService {
         dbService.cleanContextPropertyByPrefix(ctx, "test");
         assertEquals(2,ctx.getAttributeKeySet().size());
     }
+    
+    @Test
+    public void testSaveUploadConfig() throws SvcLogicException
+    {
+        SvcLogicContext ctx = new SvcLogicContext();
+        ctx.setAttribute("request-id", "test");
+        ctx.setAttribute("request-action", "Configure");
+        ctx.setAttribute("originator-id", "test");
+        ctx.setAttribute("vnf-id", "test");
+        ctx.setAttribute("vm-name", "test");
+        ctx.setAttribute("vnf-host-ip-address", "10.0.0.1");
+        ctx.setAttribute("vnf-type", "test");
+        ctx.setAttribute("vnfc-type", "test");
+        ctx.setAttribute("tmp.escaped.devicerunningconfig", "10.0.0.1");
+        
+        MockDGGeneralDBService dbService =     MockDGGeneralDBService.initialise();
+        QueryStatus status= dbService.saveUploadConfig(ctx, "test");
+        assertEquals(QueryStatus.SUCCESS, status);
+    }
 }