From 40a4719e58b4e1af57e1cfc208b24efca35979a5 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 6 Aug 2018 16:27:51 +0530 Subject: added test case to TestStructuredPropertyHelper to increase code coverage Issue-ID: APPC-1086 Change-Id: I27a84f312fcdaed2ff85c686d2fa2e39884b6224 Signed-off-by: Sandeep J --- .../appc/util/TestStructuredPropertyHelper.java | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'appc-common/src/test/java') diff --git a/appc-common/src/test/java/org/onap/appc/util/TestStructuredPropertyHelper.java b/appc-common/src/test/java/org/onap/appc/util/TestStructuredPropertyHelper.java index 11938f124..e61531a8b 100644 --- a/appc-common/src/test/java/org/onap/appc/util/TestStructuredPropertyHelper.java +++ b/appc-common/src/test/java/org/onap/appc/util/TestStructuredPropertyHelper.java @@ -246,5 +246,39 @@ public class TestStructuredPropertyHelper { assertEquals("testName = testValue",str); } - + @Test + public void testEquals() + { + Node node0 = new Node(); + node0.setName("testName"); + node0.setValue("testValue"); + Node node1 = new Node(); + node1.setName("testName"); + node1.setValue("testValue"); + assertTrue(node0.equals(node1)); + } + + @Test + public void testEqualsWithSameNameAndDifferentValue() + { + Node node0 = new Node(); + node0.setName("testName"); + node0.setValue("testValue1"); + Node node1 = new Node(); + node1.setName("testName"); + node1.setValue("testValue2"); + assertFalse(node0.equals(node1)); + } + + @Test + public void testEqualsWithSameValueAndDifferentName() + { + Node node0 = new Node(); + node0.setName("testName1"); + node0.setValue("testValue"); + Node node1 = new Node(); + node1.setName("testName2"); + node1.setValue("testValue"); + assertFalse(node0.equals(node1)); + } } -- cgit