From 134ca5667da901a703ecb0c78d96873712a9d0d3 Mon Sep 17 00:00:00 2001 From: xuegao Date: Mon, 22 Mar 2021 11:22:47 +0100 Subject: Improve test coverage Add unit tests to improve test coverage. Issue-ID: SDC-3428 Change-Id: I9e00af2824366ae45d47d2dcecf322fd3e9a6fea Signed-off-by: xuegao --- .../MapListCapabilityDataDefinitionTest.java | 27 +++++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'common-be/src/test/java/org/openecomp') diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java index 74adfffc15..60bcce50cd 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java @@ -21,10 +21,11 @@ package org.openecomp.sdc.be.datatypes.elements; import org.apache.commons.collections.map.HashedMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; +import static org.junit.jupiter.api.Assertions.assertEquals; public class MapListCapabilityDataDefinitionTest { @@ -42,25 +43,13 @@ public class MapListCapabilityDataDefinitionTest { new MapListCapabilityDataDefinition(createTestSubject()); } - @Test - public void testGetMapToscaDataDefinition() throws Exception { - MapListCapabilityDataDefinition testSubject; - Map result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getMapToscaDataDefinition(); - } - - @Test public void testAdd() throws Exception { - MapListCapabilityDataDefinition testSubject; - String key = ""; - CapabilityDataDefinition value = null; - - // default test - testSubject = createTestSubject(); - testSubject.add(key, value); + MapListCapabilityDataDefinition testSubject = createTestSubject(); + testSubject.add("", null); + testSubject.add("key2", null); + testSubject.add("key2", new CapabilityDataDefinition()); + assertEquals(2, testSubject.getMapToscaDataDefinition().size()); + assertEquals(2, testSubject.getMapToscaDataDefinition().get("key2").getListToscaDataDefinition().size()); } } -- cgit 1.2.3-korg