summaryrefslogtreecommitdiffstats
path: root/appc-config
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2019-01-16 20:57:52 +0530
committerTakamune Cho <takamune.cho@att.com>2019-01-16 19:08:23 +0000
commit4d15a7a87d5d2d5f7028a087d6f0df449010cb99 (patch)
treecc798bbc319b0afaea3fcad2398d0f93685792d5 /appc-config
parent9121ab6986853965360d7b12dd66027f988ffdf2 (diff)
added test cases to TestDGGeneralDBService
to increase code coverage Issue-ID: APPC-1086 Change-Id: I5c765135fad3720818d76a87b7ebe1691dc39155 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config')
-rw-r--r--appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java39
1 files changed, 37 insertions, 2 deletions
diff --git a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java
index bcf649339..234b3fab5 100644
--- a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java
+++ b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestDGGeneralDBService.java
@@ -6,7 +6,7 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* ================================================================================
- * Modifications Copyright (C) 2018 IBM
+ * Modifications Copyright (C) 2018-2019 IBM
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -184,13 +184,48 @@ public class TestDGGeneralDBService {
}
@Test
+ public void testSaveConfigFiles() throws SvcLogicException {
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("data-source", "test");
+ ctx.setAttribute("service-instance-id", "test");
+ ctx.setAttribute("request-action", "test");
+ ctx.setAttribute("vnf-type", "test");
+ ctx.setAttribute("vnfc-type", "test");
+ ctx.setAttribute("vnf-id", "test");
+ ctx.setAttribute("vnf-name", "test");
+ ctx.setAttribute("vm-name", "test");
+ ctx.setAttribute("file-category", "test");
+ ctx.setAttribute("file-content", "test");
+
+ MockDGGeneralDBService dbService = MockDGGeneralDBService.initialise();
+ QueryStatus status = dbService.saveConfigFiles(ctx, "test");
+ assertEquals(QueryStatus.SUCCESS, status);
+
+ }
+
+ @Test
+ public void testSavePrepareRelationship() throws SvcLogicException {
+
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("service-instance-id", "test");
+ ctx.setAttribute("request-id", "test");
+
+
+ MockDGGeneralDBService dbService = MockDGGeneralDBService.initialise();
+ QueryStatus status = dbService.savePrepareRelationship(ctx, "test","test", "test");
+ assertEquals(QueryStatus.SUCCESS,status);
+
+ }
+
+ @Test
public void testGetDownloadConfigTemplateByVnf() throws SvcLogicException {
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("vnf-type", "test");
MockDGGeneralDBService dbService = MockDGGeneralDBService.initialise();
QueryStatus status = dbService.getDownloadConfigTemplateByVnf(ctx, "test");
- assertEquals(status, QueryStatus.SUCCESS);
+ assertEquals(QueryStatus.SUCCESS,status);
}
@Test