From fd07dec6fc32c6d20a5f6ca23587ec57fa2346aa Mon Sep 17 00:00:00 2001 From: xuegao Date: Tue, 16 Mar 2021 08:18:21 +0100 Subject: Improve test coverage Use Lombok annotations to improve test coverage. Issue-ID: SDC-3428 Signed-off-by: xuegao Change-Id: I3701c1ae8f8a1648c17227095071a7a581eb8ac1 --- .../sdc/be/model/ComponentDependency.java | 71 +++------------------- .../constraints/GreaterOrEqualConstraint.java | 19 ++---- 2 files changed, 13 insertions(+), 77 deletions(-) (limited to 'catalog-model/src/main/java') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentDependency.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentDependency.java index b0f3f3fa91..ab4463caea 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentDependency.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentDependency.java @@ -20,10 +20,16 @@ package org.openecomp.sdc.be.model; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + import java.util.ArrayList; import java.util.List; - +@Getter +@Setter +@NoArgsConstructor public class ComponentDependency { private String name; private String version; @@ -35,69 +41,6 @@ public class ComponentDependency { private List dependencies; - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getUniqueId() { - return uniqueId; - } - - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public List getDependencies() { - return dependencies; - } - - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public List getInstanceNames() { - return instanceNames; - } - - public void setInstanceNames(List instanceNames) { - this.instanceNames = instanceNames; - } - - public void setDependencies(List dependencies) { - this.dependencies = dependencies; - } public void addDependencies(List dependencies) { if ( this.dependencies == null ){ this.dependencies = new ArrayList<>(); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java index 2b23445452..cd132502ac 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java @@ -20,6 +20,9 @@ package org.openecomp.sdc.be.model.tosca.constraints; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; import org.openecomp.sdc.be.model.PropertyConstraint; import org.openecomp.sdc.be.model.tosca.ToscaType; import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintFunctionalException; @@ -29,15 +32,14 @@ import org.openecomp.sdc.be.model.tosca.constraints.exception.PropertyConstraint import javax.validation.constraints.NotNull; +@Getter +@Setter +@AllArgsConstructor public class GreaterOrEqualConstraint extends AbstractComparablePropertyConstraint { @NotNull private String greaterOrEqual; - public GreaterOrEqualConstraint(String greaterOrEqual) { - this.greaterOrEqual = greaterOrEqual; - } - @Override public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { initialize(greaterOrEqual, propertyType); @@ -64,13 +66,4 @@ public class GreaterOrEqualConstraint extends AbstractComparablePropertyConstrai public String getErrorMessage(ToscaType toscaType, ConstraintFunctionalException e, String propertyName) { return getErrorMessage(toscaType, e, propertyName, "%f property value must be >= %f", greaterOrEqual); } - - public String getGreaterOrEqual() { - return greaterOrEqual; - } - - public void setGreaterOrEqual(String greaterOrEqual) { - this.greaterOrEqual = greaterOrEqual; - } - } -- cgit 1.2.3-korg