aboutsummaryrefslogtreecommitdiffstats
path: root/common-be
diff options
context:
space:
mode:
authorstasys10 <stasys.jurgaitis@est.tech>2021-11-29 19:52:58 +0000
committerAndr� Schmid <andre.schmid@est.tech>2022-01-27 16:59:25 +0000
commit9bd18657d2048d3396d15a394b4493b283c47e4d (patch)
treee4bd0deef57d238fab57621a1b9382d9cbb5c031 /common-be
parentc2fa1b7e8d43a236219d1f6ad2831de1af296cb4 (diff)
Add a display name for the category
Issue-ID: SDC-3858 Change-Id: Ic818b3b4bc4f4e91c9da0cdacb40549a3f071c68 Signed-off-by: stasys10 <stasys.jurgaitis@est.tech>
Diffstat (limited to 'common-be')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinition.java2
-rw-r--r--common-be/src/test/java/org/openecomp/sdc/be/datatypes/category/CategoryDataDefinitionTest.java44
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());
}
-
}