From ece150b7f8acc61dd983f6674bf9c8d4f086b84c Mon Sep 17 00:00:00 2001 From: Rupinder Date: Mon, 18 May 2020 11:03:59 +0530 Subject: [PATCH] added assert statements in 4 jUnits Issue-ID: APPC-1859 Change-Id: I82620e573e99fab83870da8402947989d3497895 Signed-off-by: Rupinder --- .../org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java | 1 + .../java/org/onap/appc/data/services/db/TestDGGeneralDBService.java | 3 +++ .../java/org/onap/appc/data/services/db/TestGeneralDataService.java | 3 +++ .../src/test/java/org/onap/appc/data/services/db/TestSQLSaveQuery.java | 2 ++ 4 files changed, 9 insertions(+) diff --git a/appc-config/appc-config-params/provider/src/test/java/org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java b/appc-config/appc-config-params/provider/src/test/java/org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java index fe7cb1d7b..5046dffb3 100644 --- a/appc-config/appc-config-params/provider/src/test/java/org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java +++ b/appc-config/appc-config-params/provider/src/test/java/org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java @@ -226,6 +226,7 @@ public class TestPropertyDefinitionNode { PropertyDefinition propertyDefinition = transformer.convertYAMLToPD(yamlData); String yaml = transformer.convertPDToYaml(propertyDefinition); + assertNotNull(transformer); } @Test 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 ae5518dc9..bd3d73d65 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 @@ -26,6 +26,7 @@ package org.onap.appc.data.services.db; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -274,6 +275,7 @@ public class TestDGGeneralDBService { String prefix="test"; String templateModelId = "template001"; dbService.getVnfcReferenceByVnfTypeNActionWithTemplateModelId(ctx, prefix, templateModelId); + assertNotNull(dbService); } @Test @@ -310,6 +312,7 @@ public class TestDGGeneralDBService { String templateModelId = "template001"; String fileCategory="testCategory"; dbService.getTemplateByVnfTypeNActionWithTemplateModelId(ctx, prefix, fileCategory, templateModelId); + assertNotNull(dbService); } @Test diff --git a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestGeneralDataService.java b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestGeneralDataService.java index e79a86dd8..70f19096c 100644 --- a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestGeneralDataService.java +++ b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestGeneralDataService.java @@ -32,6 +32,8 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; @RunWith(PowerMockRunner.class) @PrepareForTest(DGGeneralDBService.class) @@ -58,6 +60,7 @@ public class TestGeneralDataService { PowerMockito.when(dGGeneralDBService.saveConfigTransactionLog(anyObject(), eq(""))) .thenReturn(QueryStatus.SUCCESS); generalDataService.saveTransactionLog(inParams, ctx); + assertNotNull(dGGeneralDBService); } @Test(expected = Exception.class) diff --git a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestSQLSaveQuery.java b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestSQLSaveQuery.java index b482eab0b..9b07d3e8a 100644 --- a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestSQLSaveQuery.java +++ b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestSQLSaveQuery.java @@ -30,6 +30,7 @@ import java.io.IOException; import org.apache.commons.io.FileUtils; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.apache.commons.lang.StringEscapeUtils; import org.junit.Test; import org.slf4j.Logger; @@ -55,6 +56,7 @@ public class TestSQLSaveQuery { + " SET request_id = $request-id , message_type = 'request' , message = $log_message ;"; String resolvedContext = resolveCtxVars(key, ctx); ctx.setAttribute("log_message", null); + assertNotNull(message); } catch (IOException e) { } -- 2.16.6