From 6e6a179914fd6b8516c697991a501535bfc53172 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sat, 4 Aug 2018 20:32:31 +0300 Subject: add removed unit tests Change-Id: Iabd593d8d9ab0efeb32032d5c4d72b8fa1c27e63 Issue-ID: SDC-1590 Signed-off-by: Michael Lando --- .../elements/CompositionDataDefinitionTest.java | 81 ++++++++++++++++++++++ .../MapListCapabiltyDataDefinitionTest.java | 46 ++++++++++++ .../MapListRequirementDataDefinitionTest.java | 38 ++++++++++ 3 files changed, 165 insertions(+) create mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinitionTest.java create mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java create mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java (limited to 'common-be/src/test/java/org') diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinitionTest.java new file mode 100644 index 0000000000..92faa74f3c --- /dev/null +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinitionTest.java @@ -0,0 +1,81 @@ +package org.openecomp.sdc.be.datatypes.elements; + +import java.util.Map; + +import org.junit.Test; + + +public class CompositionDataDefinitionTest { + + private CompositionDataDefinition createTestSubject() { + return new CompositionDataDefinition(); + } + + + @Test + public void testGetComponentInstances() throws Exception { + CompositionDataDefinition testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstances(); + } + + + @Test + public void testSetComponentInstances() throws Exception { + CompositionDataDefinition testSubject; + Map componentInstances = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstances(componentInstances); + } + + + @Test + public void testGetRelations() throws Exception { + CompositionDataDefinition testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRelations(); + } + + + @Test + public void testSetRelations() throws Exception { + CompositionDataDefinition testSubject; + Map relations = null; + + // default test + testSubject = createTestSubject(); + testSubject.setRelations(relations); + } + + + @Test + public void testAddInstance() throws Exception { + CompositionDataDefinition testSubject; + String key = ""; + ComponentInstanceDataDefinition instance = null; + + // default test + testSubject = createTestSubject(); + testSubject.addInstance(key, instance); + } + + + @Test + public void testAddRelation() throws Exception { + CompositionDataDefinition testSubject; + String key = ""; + RelationshipInstDataDefinition relation = null; + + // default test + testSubject = createTestSubject(); + testSubject.addRelation(key, relation); + } +} \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java new file mode 100644 index 0000000000..43fefcfe09 --- /dev/null +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.be.datatypes.elements; + +import org.apache.commons.collections.map.HashedMap; +import org.junit.Test; + +import java.util.Map; + + +public class MapListCapabiltyDataDefinitionTest { + + private MapListCapabilityDataDefinition createTestSubject() { + return new MapListCapabilityDataDefinition(); + } + + @Test + public void testConstructors() throws Exception { + MapListCapabilityDataDefinition testSubject; + Map result; + + // default test + new MapListCapabilityDataDefinition(new HashedMap()); + 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); + } +} \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java new file mode 100644 index 0000000000..82f0e0ea06 --- /dev/null +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.be.datatypes.elements; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; + + +public class MapListRequirementDataDefinitionTest { + + private MapListRequirementDataDefinition createTestSubject() { + Map map = new HashMap<>(); + return new MapListRequirementDataDefinition(map); + } + + + @Test + public void testGetMapToscaDataDefinition() throws Exception { + MapListRequirementDataDefinition testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMapToscaDataDefinition(); + } + + + @Test + public void testAdd() throws Exception { + MapListRequirementDataDefinition testSubject; + String key = ""; + RequirementDataDefinition value = null; + + // default test + testSubject = createTestSubject(); + testSubject.add(key, value); + } +} \ No newline at end of file -- cgit 1.2.3-korg