From 4d15a7a87d5d2d5f7028a087d6f0df449010cb99 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 16 Jan 2019 20:57:52 +0530 Subject: added test cases to TestDGGeneralDBService to increase code coverage Issue-ID: APPC-1086 Change-Id: I5c765135fad3720818d76a87b7ebe1691dc39155 Signed-off-by: Sandeep J --- .../data/services/db/TestDGGeneralDBService.java | 39 ++++++++++++++++++++-- 1 file 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. @@ -183,6 +183,41 @@ public class TestDGGeneralDBService { assertEquals(QueryStatus.SUCCESS, status); } + @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 { @@ -190,7 +225,7 @@ public class TestDGGeneralDBService { ctx.setAttribute("vnf-type", "test"); MockDGGeneralDBService dbService = MockDGGeneralDBService.initialise(); QueryStatus status = dbService.getDownloadConfigTemplateByVnf(ctx, "test"); - assertEquals(status, QueryStatus.SUCCESS); + assertEquals(QueryStatus.SUCCESS,status); } @Test -- cgit 1.2.3-korg