From 5b593496b8f1b8e8be8d7d2dbcc223332e65a49b Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 29 Jul 2018 16:13:45 +0300 Subject: re base code Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5 Issue-ID: SDC-1566 Signed-off-by: Michael Lando --- .../category/CategoryDataDefinitionTest.java | 4 +- .../category/SubCategoryDataDefinitionTest.java | 4 +- .../AdditionalInfoParameterDataDefinitionTest.java | 4 +- .../elements/ArtifactDataDefinitionTest.java | 8 +- .../elements/CapabilityDataDefinitionTest.java | 6 +- .../elements/CapabilityTypeDataDefinitionTest.java | 4 +- .../elements/CompositionDataDefinitionTest.java | 81 --------- .../elements/GetInputValueDataDefinitionTest.java | 4 +- .../elements/GroupDataDefinitionTest.java | 4 +- .../elements/GroupInstanceDataDefinitionTest.java | 12 +- .../elements/GroupTypeDataDefinitionTest.java | 4 +- .../elements/InputDataDefinitionTest.java | 4 +- .../elements/InterfaceDataDefinitionTest.java | 4 +- .../elements/ListCapabilityDataDefinitionTest.java | 4 +- .../datatypes/elements/ListDataDefinitionTest.java | 6 +- .../ListMapPropertiesDataDefinitionTest.java | 4 +- .../ListRequirementDataDefinitionTest.java | 4 +- .../elements/MapArtifactDataDefinitionTest.java | 4 +- .../elements/MapCapabilityPropertyTest.java | 43 +++++ .../elements/MapCapabiltyPropertyTest.java | 43 ----- .../MapComponentInstanceExternalRefsTest.java | 4 +- .../datatypes/elements/MapDataDefinitionTest.java | 7 +- .../elements/MapGroupsDataDefinitionTest.java | 4 +- .../MapListCapabilityDataDefinitionTest.java | 46 +++++ .../MapListCapabiltyDataDefinitionTest.java | 46 ----- .../MapListRequirementDataDefinitionTest.java | 38 ---- .../elements/MapPropertiesDataDefinitionTest.java | 4 +- .../elements/PolicyDataDefinitionTest.java | 6 +- .../elements/PolicyTypeDataDefinitionTest.java | 4 +- .../ProductMetadataDataDefinitionTest.java | 4 +- .../elements/PropertyDataDefinitionTest.java | 199 ++++++++++++++++----- .../be/datatypes/elements/PropertyRuleTest.java | 6 +- .../RelationshipInstDataDefinitionTest.java | 4 +- .../elements/RequirementDataDefinitionTest.java | 4 +- .../datatypes/elements/SchemaDefinitionTest.java | 10 +- .../datatypes/enums/ComponentFieldsEnumTest.java | 2 - .../sdc/be/datatypes/enums/FilterKeyEnumTest.java | 4 +- .../be/datatypes/enums/GraphPropertyEnumTest.java | 4 +- .../openecomp/sdc/be/utils/CommonBeUtilsTest.java | 7 +- 39 files changed, 314 insertions(+), 340 deletions(-) delete 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/MapCapabilityPropertyTest.java delete mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyPropertyTest.java create mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.java delete mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java delete mode 100644 common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java (limited to 'common-be/src/test') diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinitionTest.java index 1c7e3e6765..9ea0a3f108 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.category; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.List; + public class CategoryDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinitionTest.java index 7ef3e26c63..ed7c320d3a 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/SubCategoryDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.category; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.List; + public class SubCategoryDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinitionTest.java index f73858e7b2..e6bd071bbb 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class AdditionalInfoParameterDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinitionTest.java index 04e2461115..a85ccd9f6a 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinitionTest.java @@ -1,13 +1,13 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; - import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; + public class ArtifactDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinitionTest.java index 72b1196234..24a71fcbf5 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinitionTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.LinkedList; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.LinkedList; +import java.util.List; + public class CapabilityDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinitionTest.java index ea2f205bac..5e3067413b 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class CapabilityTypeDataDefinitionTest { private CapabilityTypeDataDefinition createTestSubject() { 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 deleted file mode 100644 index 92faa74f3c..0000000000 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinitionTest.java +++ /dev/null @@ -1,81 +0,0 @@ -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/GetInputValueDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinitionTest.java index bfc9749562..3eeea7768f 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.HashMap; - import org.junit.Assert; import org.junit.Test; +import java.util.HashMap; + public class GetInputValueDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinitionTest.java index c4b7045193..80a703f646 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinitionTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; - public class GroupDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinitionTest.java index 3328f5e46b..1fa9bde852 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinitionTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import org.junit.Test; - public class GroupInstanceDataDefinitionTest { @@ -491,12 +491,4 @@ public class GroupInstanceDataDefinitionTest { testSubject.setProperties(properties); } - - @Test - public void testGetSerialversionuid() throws Exception { - long result; - - // default test - result = GroupInstanceDataDefinition.getSerialversionuid(); - } } \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinitionTest.java index ae62dbc339..5bd3515812 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.List; import java.util.Map; -import org.junit.Test; - public class GroupTypeDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinitionTest.java index b8e0a1fd72..35cfb6638a 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.HashMap; - import org.junit.Test; +import java.util.HashMap; + public class InputDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java index 63d4e0ded6..966dce634b 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.Map; - import org.junit.Test; +import java.util.Map; + public class InterfaceDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinitionTest.java index 848b553738..15e759b52c 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.LinkedList; import java.util.List; -import org.junit.Test; - public class ListCapabilityDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinitionTest.java index 5b9769ff0d..c0d72872a0 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinitionTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; -import java.util.Set; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; +import java.util.List; +import java.util.Set; + public class ListDataDefinitionTest { private ListDataDefinition createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinitionTest.java index 2939950386..6dab3b2bc7 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.LinkedList; import java.util.List; -import org.junit.Test; - public class ListMapPropertiesDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinitionTest.java index 682c43cc8c..5cdc132f40 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.LinkedList; import java.util.List; -import org.junit.Test; - public class ListRequirementDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinitionTest.java index 0b2366080b..2edf12cf47 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.HashMap; import java.util.Map; -import org.junit.Test; - public class MapArtifactDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityPropertyTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityPropertyTest.java new file mode 100644 index 0000000000..438c5e4083 --- /dev/null +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityPropertyTest.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.be.datatypes.elements; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; + +public class MapCapabilityPropertyTest { + + private MapCapabilityProperty createTestSubject() { + return new MapCapabilityProperty(); + } + + @Test + public void testOverloadConstructor() throws Exception { + MapCapabilityProperty testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + new MapCapabilityProperty(new HashMap<>()); + } + + @Test + public void testGetMapToscaDataDefinition() throws Exception { + MapCapabilityProperty testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMapToscaDataDefinition(); + } + + @Test + public void testSetMapToscaDataDefinition() throws Exception { + MapCapabilityProperty testSubject; + Map mapToscaDataDefinition = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMapToscaDataDefinition(mapToscaDataDefinition); + } +} \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyPropertyTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyPropertyTest.java deleted file mode 100644 index 914dc11d46..0000000000 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyPropertyTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openecomp.sdc.be.datatypes.elements; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; - -public class MapCapabiltyPropertyTest { - - private MapCapabiltyProperty createTestSubject() { - return new MapCapabiltyProperty(); - } - - @Test - public void testOverloadConstructor() throws Exception { - MapCapabiltyProperty testSubject; - Map result; - - // default test - testSubject = createTestSubject(); - new MapCapabiltyProperty(new HashMap<>()); - } - - @Test - public void testGetMapToscaDataDefinition() throws Exception { - MapCapabiltyProperty testSubject; - Map result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getMapToscaDataDefinition(); - } - - @Test - public void testSetMapToscaDataDefinition() throws Exception { - MapCapabiltyProperty testSubject; - Map mapToscaDataDefinition = null; - - // default test - testSubject = createTestSubject(); - testSubject.setMapToscaDataDefinition(mapToscaDataDefinition); - } -} \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefsTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefsTest.java index 068ff77b17..6c8cd18a1d 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefsTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefsTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.List; import java.util.Map; -import org.junit.Test; - public class MapComponentInstanceExternalRefsTest { private MapComponentInstanceExternalRefs createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinitionTest.java index ae7f63c505..672b7c2922 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinitionTest.java @@ -1,12 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; +import java.util.HashSet; +import java.util.Map; + public class MapDataDefinitionTest { private MapDataDefinition createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinitionTest.java index 0784f6439a..c9a3984178 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.Map; - import org.apache.commons.collections.map.HashedMap; import org.junit.Test; +import java.util.Map; + public class MapGroupsDataDefinitionTest { private MapGroupsDataDefinition createTestSubject() { 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 new file mode 100644 index 0000000000..a12c51b97b --- /dev/null +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinitionTest.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 MapListCapabilityDataDefinitionTest { + + 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/MapListCapabiltyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java deleted file mode 100644 index f335c4a45b..0000000000 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinitionTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openecomp.sdc.be.datatypes.elements; - -import java.util.Map; - -import org.apache.commons.collections.map.HashedMap; -import org.junit.Test; - - -public class MapListCapabiltyDataDefinitionTest { - - private MapListCapabiltyDataDefinition createTestSubject() { - return new MapListCapabiltyDataDefinition(); - } - - @Test - public void testConstructors() throws Exception { - MapListCapabiltyDataDefinition testSubject; - Map result; - - // default test - new MapListCapabiltyDataDefinition(new HashedMap()); - new MapListCapabiltyDataDefinition(createTestSubject()); - } - - @Test - public void testGetMapToscaDataDefinition() throws Exception { - MapListCapabiltyDataDefinition testSubject; - Map result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getMapToscaDataDefinition(); - } - - - @Test - public void testAdd() throws Exception { - MapListCapabiltyDataDefinition 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 deleted file mode 100644 index 82f0e0ea06..0000000000 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinitionTest.java +++ /dev/null @@ -1,38 +0,0 @@ -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 diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinitionTest.java index 56ea2baedb..cfa8123ea9 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.HashMap; import java.util.Map; -import org.junit.Test; - public class MapPropertiesDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinitionTest.java index f3e4f29ae7..b28ba1c62f 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinitionTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; - public class PolicyDataDefinitionTest { private PolicyDataDefinition createTestSubject() { @@ -311,6 +311,6 @@ public class PolicyDataDefinitionTest { // default test testSubject = createTestSubject(); - result = testSubject.containsCmptInstanceAsTarget(cmptInstId); + result = testSubject.containsTarget(cmptInstId,null); } } \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinitionTest.java index e407229956..5c4ba5b08e 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; +import org.junit.Test; + import java.util.List; import java.util.Map; -import org.junit.Test; - public class PolicyTypeDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinitionTest.java index 93bc5618de..2d4a2d4e99 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class ProductMetadataDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java index 9b067c9b80..763b245b6b 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java @@ -1,13 +1,113 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; + +import java.util.List; + +import static org.junit.Assert.*; public class PropertyDataDefinitionTest { + private PropertyDataDefinition propDef; + + @Before + public void setUp() { + propDef = new PropertyDataDefinition(); + } + + @Test + public void setStringField() { + final String name = "name"; + assertNull(propDef.getName()); + assertNull(propDef.getToscaPresentationValue(JsonPresentationFields.NAME)); + propDef.setToscaPresentationValue(JsonPresentationFields.NAME, name); + assertEquals(name, propDef.getName()); + assertEquals(name, propDef.getToscaPresentationValue(JsonPresentationFields.NAME)); + } + + @Test + public void setDefaultValue() { + final String defaultValue = "text"; + assertNull(propDef.getDefaultValue()); + assertNull(propDef.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + propDef.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, defaultValue); + assertEquals(defaultValue, propDef.getDefaultValue()); + assertEquals(defaultValue, propDef.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + } + + @Test + public void setValueNotDefinedInPropDataDefinition() { + final String defaultValue = "VF"; + assertNull(propDef.getToscaPresentationValue(JsonPresentationFields.COMPONENT_TYPE)); + propDef.setToscaPresentationValue(JsonPresentationFields.COMPONENT_TYPE, defaultValue); + assertEquals(defaultValue, propDef.getToscaPresentationValue(JsonPresentationFields.COMPONENT_TYPE)); + } + + @Test + public void setBooleanField() { + assertFalse((Boolean) propDef.getToscaPresentationValue(JsonPresentationFields.PASSWORD)); + assertFalse(propDef.isPassword()); + propDef.setToscaPresentationValue(JsonPresentationFields.PASSWORD, Boolean.TRUE); + assertTrue(propDef.isPassword()); + assertTrue((Boolean) propDef.getToscaPresentationValue(JsonPresentationFields.PASSWORD)); + } + + @Test + public void mergeDefaultValueWhenItWasNullBeforeMerge() { + final String defaultValue = "12345"; + final String type = "1"; + PropertyDataDefinition propForMerge = new PropertyDataDefinition(); + propForMerge.setType(type); + + propDef.setType(type); + propDef.setDefaultValue(defaultValue); + assertNull(propForMerge.getDefaultValue()); + assertNull(propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + propDef.mergeFunction(propForMerge, true); + assertEquals(defaultValue, propForMerge.getDefaultValue()); + assertEquals(defaultValue, propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + } + + @Test + public void mergeDefaultValueAndOverrideIt() { + final String defaultValue = "12345"; + final String defaultValueForOther = "7890"; + final String type = "1"; + PropertyDataDefinition propForMerge = new PropertyDataDefinition(); + propForMerge.setType(type); + propForMerge.setDefaultValue(defaultValueForOther); + + propDef.setType(type); + propDef.setDefaultValue(defaultValue); + assertEquals(defaultValueForOther, propForMerge.getDefaultValue()); + assertEquals(defaultValueForOther, propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + propDef.mergeFunction(propForMerge, true); + assertEquals(defaultValue, propForMerge.getDefaultValue()); + assertEquals(defaultValue, propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + } + + @Test + public void mergeDefaultValueWhenOverridingIsNotAllowed() { + final String defaultValue = "12345"; + final String defaultValueForOther = "7890"; + final String type = "1"; + PropertyDataDefinition propForMerge = new PropertyDataDefinition(); + propForMerge.setType(type); + propForMerge.setDefaultValue(defaultValueForOther); + + propDef.setType(type); + propDef.setDefaultValue(defaultValue); + assertEquals(defaultValueForOther, propForMerge.getDefaultValue()); + assertEquals(defaultValueForOther, propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + propDef.mergeFunction(propForMerge, false); + assertEquals(defaultValueForOther, propForMerge.getDefaultValue()); + assertEquals(defaultValueForOther, propForMerge.getToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE)); + } + private PropertyDataDefinition createTestSubject() { return new PropertyDataDefinition(); } @@ -21,7 +121,7 @@ public class PropertyDataDefinitionTest { testSubject = createTestSubject(); new PropertyDataDefinition(testSubject); } - + @Test public void testGetInputPath() throws Exception { PropertyDataDefinition testSubject; @@ -32,7 +132,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getInputPath(); } - + @Test public void testSetInputPath() throws Exception { PropertyDataDefinition testSubject; @@ -43,7 +143,7 @@ public class PropertyDataDefinitionTest { testSubject.setInputPath(inputPath); } - + @Test public void testGetName() throws Exception { PropertyDataDefinition testSubject; @@ -54,7 +154,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getName(); } - + @Test public void testSetName() throws Exception { PropertyDataDefinition testSubject; @@ -65,7 +165,7 @@ public class PropertyDataDefinitionTest { testSubject.setName(name); } - + @Test public void testGetValue() throws Exception { PropertyDataDefinition testSubject; @@ -76,7 +176,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getValue(); } - + @Test public void testSetValue() throws Exception { PropertyDataDefinition testSubject; @@ -87,7 +187,7 @@ public class PropertyDataDefinitionTest { testSubject.setValue(value); } - + @Test public void testIsDefinition() throws Exception { PropertyDataDefinition testSubject; @@ -98,7 +198,7 @@ public class PropertyDataDefinitionTest { result = testSubject.isDefinition(); } - + @Test public void testSetDefinition() throws Exception { PropertyDataDefinition testSubject; @@ -109,7 +209,7 @@ public class PropertyDataDefinitionTest { testSubject.setDefinition(definition); } - + @Test public void testGetType() throws Exception { PropertyDataDefinition testSubject; @@ -120,7 +220,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getType(); } - + @Test public void testGetDefaultValue() throws Exception { PropertyDataDefinition testSubject; @@ -131,7 +231,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getDefaultValue(); } - + @Test public void testSetDefaultValue() throws Exception { PropertyDataDefinition testSubject; @@ -142,7 +242,7 @@ public class PropertyDataDefinitionTest { testSubject.setDefaultValue(defaultValue); } - + @Test public void testSetType() throws Exception { PropertyDataDefinition testSubject; @@ -153,7 +253,7 @@ public class PropertyDataDefinitionTest { testSubject.setType(type); } - + @Test public void testIsRequired() throws Exception { PropertyDataDefinition testSubject; @@ -164,7 +264,7 @@ public class PropertyDataDefinitionTest { result = testSubject.isRequired(); } - + @Test public void testSetRequired() throws Exception { PropertyDataDefinition testSubject; @@ -175,7 +275,7 @@ public class PropertyDataDefinitionTest { testSubject.setRequired(required); } - + @Test public void testGetDescription() throws Exception { PropertyDataDefinition testSubject; @@ -186,7 +286,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getDescription(); } - + @Test public void testSetDescription() throws Exception { PropertyDataDefinition testSubject; @@ -197,7 +297,7 @@ public class PropertyDataDefinitionTest { testSubject.setDescription(description); } - + @Test public void testIsPassword() throws Exception { PropertyDataDefinition testSubject; @@ -208,7 +308,7 @@ public class PropertyDataDefinitionTest { result = testSubject.isPassword(); } - + @Test public void testSetPassword() throws Exception { PropertyDataDefinition testSubject; @@ -219,7 +319,7 @@ public class PropertyDataDefinitionTest { testSubject.setPassword(password); } - + @Test public void testGetUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -230,7 +330,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getUniqueId(); } - + @Test public void testSetUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -241,7 +341,7 @@ public class PropertyDataDefinitionTest { testSubject.setUniqueId(uniqueId); } - + @Test public void testGetSchema() throws Exception { PropertyDataDefinition testSubject; @@ -252,7 +352,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getSchema(); } - + @Test public void testSetSchema() throws Exception { PropertyDataDefinition testSubject; @@ -263,7 +363,7 @@ public class PropertyDataDefinitionTest { testSubject.setSchema(entrySchema); } - + @Test public void testGetLabel() throws Exception { PropertyDataDefinition testSubject; @@ -274,7 +374,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getLabel(); } - + @Test public void testSetLabel() throws Exception { PropertyDataDefinition testSubject; @@ -285,7 +385,7 @@ public class PropertyDataDefinitionTest { testSubject.setLabel(label); } - + @Test public void testIsHidden() throws Exception { PropertyDataDefinition testSubject; @@ -296,7 +396,7 @@ public class PropertyDataDefinitionTest { result = testSubject.isHidden(); } - + @Test public void testSetHidden() throws Exception { PropertyDataDefinition testSubject; @@ -307,7 +407,7 @@ public class PropertyDataDefinitionTest { testSubject.setHidden(hidden); } - + @Test public void testIsImmutable() throws Exception { PropertyDataDefinition testSubject; @@ -318,7 +418,7 @@ public class PropertyDataDefinitionTest { result = testSubject.isImmutable(); } - + @Test public void testSetImmutable() throws Exception { PropertyDataDefinition testSubject; @@ -329,7 +429,7 @@ public class PropertyDataDefinitionTest { testSubject.setImmutable(immutable); } - + @Test public void testGetParentUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -340,7 +440,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getParentUniqueId(); } - + @Test public void testSetParentUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -351,7 +451,7 @@ public class PropertyDataDefinitionTest { testSubject.setParentUniqueId(parentUniqueId); } - + @Test public void testGetGetInputValues() throws Exception { PropertyDataDefinition testSubject; @@ -362,7 +462,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getGetInputValues(); } - + @Test public void testSetGetInputValues() throws Exception { PropertyDataDefinition testSubject; @@ -373,7 +473,7 @@ public class PropertyDataDefinitionTest { testSubject.setGetInputValues(getInputValues); } - + @Test public void testGetStatus() throws Exception { PropertyDataDefinition testSubject; @@ -384,7 +484,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getStatus(); } - + @Test public void testSetStatus() throws Exception { PropertyDataDefinition testSubject; @@ -395,7 +495,7 @@ public class PropertyDataDefinitionTest { testSubject.setStatus(status); } - + @Test public void testGetInputId() throws Exception { PropertyDataDefinition testSubject; @@ -406,7 +506,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getInputId(); } - + @Test public void testSetInputId() throws Exception { PropertyDataDefinition testSubject; @@ -417,7 +517,7 @@ public class PropertyDataDefinitionTest { testSubject.setInputId(inputId); } - + @Test public void testGetInstanceUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -428,7 +528,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getInstanceUniqueId(); } - + @Test public void testSetInstanceUniqueId() throws Exception { PropertyDataDefinition testSubject; @@ -439,7 +539,7 @@ public class PropertyDataDefinitionTest { testSubject.setInstanceUniqueId(instanceUniqueId); } - + @Test public void testGetPropertyId() throws Exception { PropertyDataDefinition testSubject; @@ -450,7 +550,7 @@ public class PropertyDataDefinitionTest { result = testSubject.getPropertyId(); } - + @Test public void testSetPropertyId() throws Exception { PropertyDataDefinition testSubject; @@ -461,7 +561,7 @@ public class PropertyDataDefinitionTest { testSubject.setPropertyId(propertyId); } - + @Test public void testToString() throws Exception { PropertyDataDefinition testSubject; @@ -472,7 +572,7 @@ public class PropertyDataDefinitionTest { result = testSubject.toString(); } - + @Test public void testHashCode() throws Exception { PropertyDataDefinition testSubject; @@ -483,7 +583,7 @@ public class PropertyDataDefinitionTest { result = testSubject.hashCode(); } - + @Test public void testEquals() throws Exception { PropertyDataDefinition testSubject; @@ -500,7 +600,7 @@ public class PropertyDataDefinitionTest { result = testSubject.equals(createTestSubject()); Assert.assertEquals(true, result); } - + @Test public void testConvertPropertyDataToInstancePropertyData() throws Exception { PropertyDataDefinition testSubject; @@ -509,7 +609,7 @@ public class PropertyDataDefinitionTest { testSubject = createTestSubject(); testSubject.convertPropertyDataToInstancePropertyData(); } - + @Test public void testTypeEquals() throws Exception { PropertyDataDefinition testSubject; @@ -520,7 +620,7 @@ public class PropertyDataDefinitionTest { testSubject.typeEquals(null); testSubject.typeEquals(createTestSubject()); } - + @Test public void testMergeFunction() throws Exception { PropertyDataDefinition testSubject; @@ -528,5 +628,6 @@ public class PropertyDataDefinitionTest { // default test testSubject = createTestSubject(); testSubject.mergeFunction(createTestSubject(), false); + } -} \ No newline at end of file +} diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyRuleTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyRuleTest.java index f65330e22a..95d2ccd117 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyRuleTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyRuleTest.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.LinkedList; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.LinkedList; +import java.util.List; + public class PropertyRuleTest { private PropertyRule createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinitionTest.java index 7c1f18a603..71723fb9c0 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinitionTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class RelationshipInstDataDefinitionTest { private RelationshipInstDataDefinition createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinitionTest.java index 2965e07f7e..1f4da5b5b1 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinitionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.List; + public class RequirementDataDefinitionTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinitionTest.java index 53b9b8d6f9..d50828e360 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinitionTest.java @@ -1,13 +1,14 @@ package org.openecomp.sdc.be.datatypes.elements; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import org.apache.commons.collections.map.HashedMap; import org.junit.Assert; import org.junit.Test; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + public class SchemaDefinitionTest { private SchemaDefinition createTestSubject() { @@ -112,6 +113,7 @@ public class SchemaDefinitionTest { // default test testSubject = createTestSubject(); + testSubject.setProperties(new HashMap<>() ); testSubject.addProperty("mock", property); } diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnumTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnumTest.java index ef02c72c91..3b6a1f604b 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnumTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.datatypes.enums; -import javax.annotation.Generated; - import org.junit.Test; public class ComponentFieldsEnumTest { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java index 66147dc1bf..8c72843707 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.enums; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class FilterKeyEnumTest { private FilterKeyEnum createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnumTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnumTest.java index 74bcf172e8..e59d306a9f 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnumTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnumTest.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.datatypes.enums; -import java.util.List; - import org.junit.Test; +import java.util.List; + public class GraphPropertyEnumTest { private GraphPropertyEnum createTestSubject() { diff --git a/common-be/src/test/java/org/openecomp/sdc/be/utils/CommonBeUtilsTest.java b/common-be/src/test/java/org/openecomp/sdc/be/utils/CommonBeUtilsTest.java index 07eb1aefb0..dbe17e6968 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/utils/CommonBeUtilsTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/utils/CommonBeUtilsTest.java @@ -20,11 +20,12 @@ package org.openecomp.sdc.be.utils; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; - public class CommonBeUtilsTest { @Test @@ -43,7 +44,7 @@ public class CommonBeUtilsTest { public void testConformanceLevelCompare() { assertTrue(CommonBeUtils.conformanceLevelCompare("1.1", "0.15") > 0); - assertTrue(CommonBeUtils.conformanceLevelCompare("0.5", "0.5") == 0); + assertEquals(0, CommonBeUtils.conformanceLevelCompare("0.5", "0.5")); assertTrue(CommonBeUtils.conformanceLevelCompare("0.5", "0.6") < 0); assertTrue(CommonBeUtils.conformanceLevelCompare("1.5", "2.6") < 0); assertTrue(CommonBeUtils.conformanceLevelCompare("1.5", "1.5.3") < 0); -- cgit 1.2.3-korg