summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2020-03-26 17:25:54 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-30 05:11:15 +0000
commitee80eb11d8ace0117ea1084c5ac16d8d271b8fd9 (patch)
tree7fb61496a0fc01087fb2760da4bc9ff044b21a8b /catalog-model/src/main
parent7422f22140b7ce24e3e735dabaa325e2f7a4fc92 (diff)
Increase test coverage
Change-Id: If9b371042a42213f38828f9628714d076261f25c Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-2833
Diffstat (limited to 'catalog-model/src/main')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/category/CategoryDefinition.java28
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/category/GroupingDefinition.java5
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/category/SubCategoryDefinition.java29
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/SerializedHashMap.java8
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/unittests/utils/FactoryUtils.java9
5 files changed, 32 insertions, 47 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/CategoryDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/CategoryDefinition.java
index d943fb0a05..44a0362a41 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/CategoryDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/CategoryDefinition.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,11 +20,18 @@
package org.openecomp.sdc.be.model.category;
-import org.openecomp.sdc.be.datatypes.category.CategoryDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.openecomp.sdc.be.datatypes.category.CategoryDataDefinition;
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
public class CategoryDefinition extends CategoryDataDefinition {
private List<SubCategoryDefinition> subcategories;
@@ -37,14 +44,6 @@ public class CategoryDefinition extends CategoryDataDefinition {
super(c);
}
- public List<SubCategoryDefinition> getSubcategories() {
- return subcategories;
- }
-
- public void setSubcategories(List<SubCategoryDefinition> subcategories) {
- this.subcategories = subcategories;
- }
-
public void addSubCategory(SubCategoryDefinition subcategory) {
if (subcategories == null) {
subcategories = new ArrayList<>();
@@ -52,9 +51,4 @@ public class CategoryDefinition extends CategoryDataDefinition {
subcategories.add(subcategory);
}
- @Override
- public String toString() {
- return super.toString() + " CategoryDefinition [subcategories=" + subcategories + "]";
- }
-
}
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/GroupingDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/GroupingDefinition.java
index 8d839332fe..f8436db7db 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/GroupingDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/GroupingDefinition.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,6 @@ import org.openecomp.sdc.be.datatypes.category.GroupingDataDefinition;
public class GroupingDefinition extends GroupingDataDefinition {
public GroupingDefinition() {
- super();
}
public GroupingDefinition(GroupingDataDefinition g) {
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/SubCategoryDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/SubCategoryDefinition.java
index c9ae3ac5c5..ed7b490b54 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/SubCategoryDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/category/SubCategoryDefinition.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,31 +20,29 @@
package org.openecomp.sdc.be.model.category;
-import org.openecomp.sdc.be.datatypes.category.SubCategoryDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.openecomp.sdc.be.datatypes.category.SubCategoryDataDefinition;
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
public class SubCategoryDefinition extends SubCategoryDataDefinition {
private List<GroupingDefinition> groupings;
public SubCategoryDefinition() {
- super();
}
public SubCategoryDefinition(SubCategoryDataDefinition subCategory) {
super(subCategory);
}
- public List<GroupingDefinition> getGroupings() {
- return groupings;
- }
-
- public void setGroupings(List<GroupingDefinition> groupingDefinitions) {
- this.groupings = groupingDefinitions;
- }
-
public void addGrouping(GroupingDefinition groupingDefinition) {
if (groupings == null) {
groupings = new ArrayList<>();
@@ -52,9 +50,4 @@ public class SubCategoryDefinition extends SubCategoryDataDefinition {
groupings.add(groupingDefinition);
}
- @Override
- public String toString() {
- return super.toString() + " SubCategoryDefinition [groupings=" + groupings + "]";
- }
-
}
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/SerializedHashMap.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/SerializedHashMap.java
index d193f9ecdb..5e73ee95e2 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/SerializedHashMap.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/SerializedHashMap.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,7 +21,9 @@
package org.openecomp.sdc.be.ui.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
-public class SerializedHashMap<T,R> extends java.util.HashMap<T,R> {
+import java.util.HashMap;
+
+public class SerializedHashMap<T, R> extends HashMap<T, R> {
@JsonIgnore
@Override
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/unittests/utils/FactoryUtils.java b/catalog-model/src/main/java/org/openecomp/sdc/be/unittests/utils/FactoryUtils.java
index f83d888bd9..79f5b80953 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/unittests/utils/FactoryUtils.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/unittests/utils/FactoryUtils.java
@@ -35,14 +35,11 @@ import java.util.UUID;
public final class FactoryUtils {
private static final String STRING = "string";
+ private static final String DEFAULT_CAPABILITY_TYPE = "tosca.capabilities.Node";
private FactoryUtils() {
}
- public static final class Constants {
- public static final String DEFAULT_CAPABILITY_TYPE = "tosca.capabilities.Node";
- }
-
public static Resource createVFWithRI(String riVersion) {
Resource vf = createVF();
ComponentInstance ri = createResourceInstanceWithVersion(riVersion);
@@ -96,7 +93,7 @@ public final class FactoryUtils {
String uniqueId = UUID.randomUUID().toString();
capData.setUniqueId(uniqueId);
- capData.setType(Constants.DEFAULT_CAPABILITY_TYPE);
+ capData.setType(DEFAULT_CAPABILITY_TYPE);
return capData;
}
@@ -171,7 +168,7 @@ public final class FactoryUtils {
public static RequirementDefinition convertRequirementDataIDToRequirementDefinition(String reqDataId) {
RequirementDefinition reqDef = new RequirementDefinition();
reqDef.setUniqueId(reqDataId);
- reqDef.setCapability(Constants.DEFAULT_CAPABILITY_TYPE);
+ reqDef.setCapability(DEFAULT_CAPABILITY_TYPE);
return reqDef;
}