added test case to DBServiceTest.java 80/83580/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 28 Mar 2019 09:59:15 +0000 (15:29 +0530)
committerPatrick Brady <patrick.brady@att.com>
Thu, 28 Mar 2019 17:47:52 +0000 (17:47 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: I02b723e7f9aa83e2f7f51aa5a9c8883ac149299c
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/dbservices/DBServiceTest.java

index dd62fca..9d47403 100644 (file)
@@ -36,6 +36,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 public class DBServiceTest {
 
@@ -365,5 +366,20 @@ public class DBServiceTest {
         String expected = " AND ARTIFACT_NAME like '%_modelId.%'";
         assertEquals(expected, queryPart);
     }
+    
+    @Test
+    public void testisProtocolReferenceUpdateRequired() throws SvcLogicException {
+        MockDBService dbService = MockDBService.initialise();
+        SvcLogicContext ctx = new SvcLogicContext();
+        ctx.setAttribute("test", "test");
+        String vnfType = "testVnf";
+        String protocol = "testProtocol";
+        String action = "testAction";
+        String actionLevel = "testActionLevel";
+        String template = "testTemplateData";
+        boolean result = dbService.isProtocolReferenceUpdateRequired(ctx, vnfType, protocol, action, actionLevel, template);
+        assertTrue(result);
+    }
+    
 }