aboutsummaryrefslogtreecommitdiffstats
path: root/common-be/src/test/java/org
diff options
context:
space:
mode:
authorxuegao <xue.gao@intl.att.com>2021-03-22 11:22:47 +0100
committerxuegao <xue.gao@intl.att.com>2021-03-24 08:25:00 +0100
commit134ca5667da901a703ecb0c78d96873712a9d0d3 (patch)
tree38738cddb2798a54d1f81c22d005b9ff1e0c79f0 /common-be/src/test/java/org
parenteb57d1efc197968a4073b331b2dc8f40d8109847 (diff)
Improve test coverage
Add unit tests to improve test coverage. Issue-ID: SDC-3428 Change-Id: I9e00af2824366ae45d47d2dcecf322fd3e9a6fea Signed-off-by: xuegao <xue.gao@intl.att.com>
Diffstat (limited to 'common-be/src/test/java/org')
-rw-r--r--common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java27
1 files changed, 8 insertions, 19 deletions
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 {
@@ -43,24 +44,12 @@ public class MapListCapabilityDataDefinitionTest {
}
@Test
- public void testGetMapToscaDataDefinition() throws Exception {
- MapListCapabilityDataDefinition testSubject;
- Map<String, ListCapabilityDataDefinition> 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());
}
}