diff options
Diffstat (limited to 'common-be')
2 files changed, 33 insertions, 13 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java index 2a9b2e88a2..76768811f0 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java @@ -35,6 +35,7 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class CategoryDataDefinition extends ToscaDataDefinition { private String name; + private String displayName; private String normalizedName; private List<String> models; private String uniqueId; @@ -44,6 +45,7 @@ public class CategoryDataDefinition extends ToscaDataDefinition { public CategoryDataDefinition(CategoryDataDefinition c) { this.name = c.name; + this.displayName = c.displayName; this.normalizedName = c.normalizedName; this.models = c.models; this.uniqueId = c.uniqueId; 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 2cb0261a67..0060133ac4 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 @@ -20,23 +20,41 @@ package org.openecomp.sdc.be.datatypes.category; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; +class CategoryDataDefinitionTest { -public class CategoryDataDefinitionTest { - - private CategoryDataDefinition createTestSubject() { - return new CategoryDataDefinition(); - } - @Test - public void testCopyConstructor() throws Exception { - CategoryDataDefinition testSubject; + void testCategoryDataDefinition() { + CategoryDataDefinition categoryDataDefinitionForTest = new CategoryDataDefinition(); + categoryDataDefinitionForTest.setName("Category name"); + categoryDataDefinitionForTest.setDisplayName("Category displayName"); + categoryDataDefinitionForTest.setNormalizedName("Category normalizedName"); + List modelsList = new ArrayList(); + modelsList.add("Category models list item"); + categoryDataDefinitionForTest.setModels(modelsList); + categoryDataDefinitionForTest.setUniqueId("Category uniqueId"); + List iconList = new ArrayList(); + iconList.add("Category icon list item"); + categoryDataDefinitionForTest.setIcons(iconList); + categoryDataDefinitionForTest.setUseServiceSubstitutionForNestedServices(true); + List metadataKeysList = new ArrayList(); + metadataKeysList.add("Category metadataKeys list item"); + categoryDataDefinitionForTest.setMetadataKeys(metadataKeysList); + + CategoryDataDefinition categoryDataDefinitionActual = new CategoryDataDefinition(categoryDataDefinitionForTest); - // default test - testSubject = createTestSubject(); - CategoryDataDefinition categoryDataDefinition = new CategoryDataDefinition(testSubject); + assertEquals(categoryDataDefinitionForTest.getName(), categoryDataDefinitionActual.getName()); + assertEquals(categoryDataDefinitionForTest.getDisplayName(), categoryDataDefinitionActual.getDisplayName()); + assertEquals(categoryDataDefinitionForTest.getNormalizedName(), categoryDataDefinitionActual.getNormalizedName()); + assertEquals(categoryDataDefinitionForTest.getModels(), categoryDataDefinitionActual.getModels()); + assertEquals(categoryDataDefinitionForTest.getUniqueId(), categoryDataDefinitionActual.getUniqueId()); + assertEquals(categoryDataDefinitionForTest.getIcons(), categoryDataDefinitionActual.getIcons()); + assertEquals(categoryDataDefinitionForTest.isUseServiceSubstitutionForNestedServices(), categoryDataDefinitionActual.isUseServiceSubstitutionForNestedServices()); + assertEquals(categoryDataDefinitionForTest.getMetadataKeys(), categoryDataDefinitionActual.getMetadataKeys()); } - } |