From 319ef7c25ee522d27396707ac6a9f5168ecd8820 Mon Sep 17 00:00:00 2001 From: Rupinder Date: Wed, 27 May 2020 14:30:04 +0530 Subject: added assert statements in 5 test files Issue-ID: CCSDK-2232 Change-Id: I31033bc267381cf9f07701e4ebacbd318d3070d9 Signed-off-by: Rupinder --- .../org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java | 6 ++++++ .../java/org/onap/ccsdk/sli/adaptors/aai/ActionUpdateTest.java | 1 + .../test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java | 7 ++++--- .../org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequestTest.java | 1 + .../java/org/onap/ccsdk/sli/adaptors/aai/PathCreationTest.java | 4 ++++ 5 files changed, 16 insertions(+), 3 deletions(-) (limited to 'aai-service/provider/src') diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java index 9905991a7..b0272f5d0 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java @@ -6,6 +6,7 @@ import java.util.Properties; import org.junit.BeforeClass; import org.junit.Test; +import static org.junit.Assert.assertNotNull; public class AAIClientRESTExecutorTest { @@ -35,6 +36,7 @@ public class AAIClientRESTExecutorTest { } catch (AAIServiceException e) { } assert(true); + assertNotNull(nameValues); } @Test @@ -47,6 +49,7 @@ public class AAIClientRESTExecutorTest { } catch (AAIServiceException e) { } assert(true); + assertNotNull(nameValues); } @Test @@ -59,6 +62,7 @@ public class AAIClientRESTExecutorTest { } catch (AAIServiceException e) { } assert(true); + assertNotNull(nameValues); } @Test @@ -71,6 +75,7 @@ public class AAIClientRESTExecutorTest { } catch (AAIServiceException e) { } assert(true); + assertNotNull(nameValues); } @Test @@ -83,6 +88,7 @@ public class AAIClientRESTExecutorTest { } catch (AAIServiceException e) { } assert(true); + assertNotNull(nameValues); } diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/ActionUpdateTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/ActionUpdateTest.java index 607182ea9..64f9b45ef 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/ActionUpdateTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/ActionUpdateTest.java @@ -19,6 +19,7 @@ public class ActionUpdateTest { public void setActionData() throws Exception { final Action resolver = new Action(); resolver.setActionData( new ArrayList()); + assertNotNull(resolver); } @Test diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java index f5339c24f..f0a33fd0a 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java @@ -105,12 +105,14 @@ public class GenericVnfTest { data.put("encrypted-access-flag","true"); QueryStatus resp = client.save("generic-vnf", false, false, "generic-vnf.vnf-id = '"+uuid+"'", data, "aaidata", ctx); + assertNotNull(ctx); } catch (Throwable e) { } + ; } @Test @@ -130,8 +132,7 @@ public class GenericVnfTest { assertTrue(response == QueryStatus.SUCCESS); LOG.info("AAIResponse: " + response.toString()); } - catch (Exception e) - { + catch (Exception e) { LOG.error("Caught exception", e); fail("Caught exception"); } @@ -155,7 +156,7 @@ public class GenericVnfTest { data.put("encrypted-access-flag","true"); QueryStatus resp = client.update("generic-vnf", "generic-vnf.vnf-id = '"+uuid+"'", data, "aaidata", ctx); - + assertNotNull(uuid); } catch (Throwable e) { diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequestTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequestTest.java index 33b383950..e52f1de04 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequestTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequestTest.java @@ -40,6 +40,7 @@ public class NodesQueryRequestTest { try { URL url = request.getRequestUrl("GET", null); + assertNotNull(url); } catch (Exception exc) { } assert(true); diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/PathCreationTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/PathCreationTest.java index f9ec9f49b..098414fd9 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/PathCreationTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/PathCreationTest.java @@ -22,6 +22,7 @@ package org.onap.ccsdk.sli.adaptors.aai; import static org.junit.Assert.fail; +import static org.junit.Assert.assertNotNull; import java.io.File; import java.io.FileReader; @@ -135,6 +136,8 @@ public class PathCreationTest { URL url = request.getRequestUrl("GET", null); url.getPath(); LOG.info("Received response"); + assertNotNull(nameValues); + } catch(Exception exc) { LOG.info("Caught exception", exc); } @@ -196,5 +199,6 @@ public class PathCreationTest { } } LOG.info(nameValues.toString()); + assertNotNull(nameValues); } } -- cgit 1.2.3-korg