summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
diff options
context:
space:
mode:
authorxuegao <xue.gao@intl.att.com>2021-03-15 14:10:57 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-16 13:31:41 +0000
commitc094ebe82e4e9797c4ee20c5e14bf293f7c193c4 (patch)
tree779d5308199edf97643a9569676bb22b41905980 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
parent1da764ea13793535597dc6518b5e953393e9dbe0 (diff)
Improve test coverage
Use Lombok annotations to improve test coverage. Issue-ID: SDC-3428 Change-Id: I78a9fa6171ba26e431b5e587b24548322c464ecc Signed-off-by: xuegao <xue.gao@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntity.java114
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java113
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComputeEntity.java71
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java104
4 files changed, 30 insertions, 372 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntity.java
index fc569d5bd4..dfdc0bc0c6 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntity.java
@@ -21,9 +21,17 @@
package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
import com.datastax.driver.mapping.annotations.*;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+@EqualsAndHashCode
+@Getter
+@Setter
+@NoArgsConstructor
@Table(keyspace = "dox", name = "vsp_component_dependency_model")
public class ComponentDependencyModelEntity implements VersionableEntity {
@@ -44,14 +52,6 @@ public class ComponentDependencyModelEntity implements VersionableEntity {
@Column(name = "relation")
private String relation;
- /**
- * Every entity class must have a default constructor according to
- * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
- * Definition of mapped classes</a>.
- */
- public ComponentDependencyModelEntity() {
- // Don't delete! Default constructor is required by DataStax driver
- }
/**
* Instantiates a new ComponentDependencyModelEntity entity.
@@ -75,102 +75,4 @@ public class ComponentDependencyModelEntity implements VersionableEntity {
public String getFirstClassCitizenId() {
return getVspId();
}
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public Version getVersion() {
- return version;
- }
-
- @Override
- public void setVersion(Version version) {
- this.version = version;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- public String getTargetComponentId() {
- return targetComponentId;
- }
-
- public void setTargetComponentId(String targetComponentId) {
- this.targetComponentId = targetComponentId;
- }
-
- public String getSourceComponentId() {
- return sourceComponentId;
- }
-
- public void setSourceComponentId(String sourceComponentId) {
- this.sourceComponentId = sourceComponentId;
- }
-
- public String getRelation() {
- return relation;
- }
-
- public void setRelation(String relation) {
- this.relation = relation;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- ComponentDependencyModelEntity that = (ComponentDependencyModelEntity) o;
-
- if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
- return false;
- }
- if (version != null ? !version.equals(that.version) : that.version != null) {
- return false;
- }
- if (id != null ? !id.equals(that.id) : that.id != null) {
- return false;
- }
- if (sourceComponentId != null ? !sourceComponentId.equals(that.sourceComponentId)
- : that.sourceComponentId != null) {
- return false;
- }
- if (targetComponentId != null ? !targetComponentId.equals(that.targetComponentId)
- : that.targetComponentId != null) {
- return false;
- }
- if (relation != null ? !relation.equals(that.relation) : that.relation != null) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = vspId != null ? vspId.hashCode() : 0;
- result = 31 * result + (version != null ? version.hashCode() : 0);
- result = 31 * result + (id != null ? id.hashCode() : 0);
- result = 31 * result + (sourceComponentId != null ? sourceComponentId.hashCode() : 0);
- result = 31 * result + (targetComponentId != null ? targetComponentId.hashCode() : 0);
- result = 31 * result + (relation != null ? relation.hashCode() : 0);
- return result;
- }
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java
index c13ce149bc..18c4d949ab 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java
@@ -21,6 +21,10 @@
package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
import com.datastax.driver.mapping.annotations.*;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
@@ -30,7 +34,10 @@ import org.openecomp.sdc.versioning.dao.types.Version;
import java.util.ArrayList;
import java.util.List;
-
+@EqualsAndHashCode
+@Getter
+@Setter
+@NoArgsConstructor
@Table(keyspace = "dox", name = "vsp_component")
public class ComponentEntity implements CompositionEntity {
public static final String ENTITY_TYPE = "Vendor Software Product Component";
@@ -52,15 +59,6 @@ public class ComponentEntity implements CompositionEntity {
private List<NicEntity> nics = new ArrayList<>();
/**
- * Every entity class must have a default constructor according to
- * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
- * Definition of mapped classes</a>.
- */
- public ComponentEntity() {
- // Don't delete! Default constructor is required by DataStax driver
- }
-
- /**
* Instantiates a new Component entity.
*
* @param vspId the vsp id
@@ -84,34 +82,6 @@ public class ComponentEntity implements CompositionEntity {
}
@Override
- public String getCompositionData() {
- return compositionData;
- }
-
- @Override
- public void setCompositionData(String compositionData) {
- this.compositionData = compositionData;
- }
-
- @Override
- public String getQuestionnaireData() {
- return questionnaireData;
- }
-
- @Override
- public void setQuestionnaireData(String questionnaireData) {
- this.questionnaireData = questionnaireData;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- @Override
public String getEntityType() {
return ENTITY_TYPE;
}
@@ -121,26 +91,6 @@ public class ComponentEntity implements CompositionEntity {
return getVspId();
}
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public Version getVersion() {
- return version;
- }
-
- @Override
- public void setVersion(Version version) {
- this.version = version;
- }
-
public ComponentData getComponentCompositionData() {
return compositionData == null ? null
: JsonUtil.json2Object(compositionData, ComponentData.class);
@@ -149,51 +99,4 @@ public class ComponentEntity implements CompositionEntity {
public void setComponentCompositionData(ComponentData component) {
this.compositionData = component == null ? null : JsonUtil.object2Json(component);
}
-
- public List<NicEntity> getNics() {
- return nics;
- }
-
- public void setNics(List<NicEntity> nics) {
- this.nics = nics;
- }
-
- @Override
- public int hashCode() {
- int result = vspId != null ? vspId.hashCode() : 0;
- result = 31 * result + (version != null ? version.hashCode() : 0);
- result = 31 * result + (id != null ? id.hashCode() : 0);
- result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0);
- result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0);
- return result;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object == null || getClass() != object.getClass()) {
- return false;
- }
-
- ComponentEntity that = (ComponentEntity) object;
-
- if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
- return false;
- }
- if (version != null ? !version.equals(that.version) : that.version != null) {
- return false;
- }
- if (id != null ? !id.equals(that.id) : that.id != null) {
- return false;
- }
- if (compositionData != null ? !compositionData.equals(that.compositionData)
- : that.compositionData != null) {
- return false;
- }
- return questionnaireData != null ? questionnaireData.equals(that.questionnaireData)
- : that.questionnaireData == null;
-
- }
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComputeEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComputeEntity.java
index 1d3c432e69..590fca602e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComputeEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComputeEntity.java
@@ -21,12 +21,18 @@
package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
import com.datastax.driver.mapping.annotations.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
import org.openecomp.sdc.versioning.dao.types.Version;
+@Getter
+@Setter
+@NoArgsConstructor
@Table(keyspace = "dox", name = "vsp_component_compute")
public class ComputeEntity implements CompositionEntity {
public static final String ENTITY_TYPE = "Vendor Software Product Component Compute Flavor";
@@ -48,15 +54,6 @@ public class ComputeEntity implements CompositionEntity {
@Column(name = "questionnaire_data")
private String questionnaireData;
- /**
- * Every entity class must have a default constructor according to
- * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
- * Definition of mapped classes</a>.
- */
- public ComputeEntity() {
- // Don't delete! Default constructor is required by DataStax driver
- }
-
public ComputeEntity(String vspId, Version version, String componentId, String id) {
this.vspId = vspId;
this.version = version;
@@ -75,26 +72,6 @@ public class ComputeEntity implements CompositionEntity {
}
@Override
- public String getId() {
- return id;
- }
-
- @Override
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public Version getVersion() {
- return version;
- }
-
- @Override
- public void setVersion(Version version) {
- this.version = version;
- }
-
- @Override
public CompositionEntityType getType() {
return CompositionEntityType.compute;
}
@@ -105,42 +82,6 @@ public class ComputeEntity implements CompositionEntity {
new CompositionEntityId(getComponentId(), new CompositionEntityId(getVspId(), null)));
}
- @Override
- public String getCompositionData() {
- return compositionData;
- }
-
- @Override
- public void setCompositionData(String compositionData) {
- this.compositionData = compositionData;
- }
-
- @Override
- public String getQuestionnaireData() {
- return questionnaireData;
- }
-
- @Override
- public void setQuestionnaireData(String questionnaireData) {
- this.questionnaireData = questionnaireData;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- public String getComponentId() {
- return componentId;
- }
-
- public void setComponentId(String componentId) {
- this.componentId = componentId;
- }
-
public ComputeData getComputeCompositionData() {
return compositionData == null ? null
: JsonUtil.json2Object(compositionData, ComputeData.class);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
index fb28154a48..dd145b1f54 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
@@ -21,12 +21,20 @@
package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
import com.datastax.driver.mapping.annotations.*;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
import org.openecomp.sdc.versioning.dao.types.Version;
+@EqualsAndHashCode
+@Getter
+@Setter
+@NoArgsConstructor
@Table(keyspace = "dox", name = "vsp_deployment_flavor")
public class DeploymentFlavorEntity implements CompositionEntity{
private static final String ENTITY_TYPE = "Vendor Software Product Deployment Flavor";
@@ -46,15 +54,6 @@ public class DeploymentFlavorEntity implements CompositionEntity{
private String questionnaireData;
/**
- * Every entity class must have a default constructor according to
- * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
- * Definition of mapped classes</a>.
- */
- public DeploymentFlavorEntity() {
- // Don't delete! Default constructor is required by DataStax driver
- }
-
- /**
* Instantiates a new DeploymentFlavor entity.
*
* @param vspId the vsp id
@@ -77,34 +76,6 @@ public class DeploymentFlavorEntity implements CompositionEntity{
}
@Override
- public String getCompositionData() {
- return compositionData;
- }
-
- @Override
- public void setCompositionData(String compositionData) {
- this.compositionData = compositionData;
- }
-
- @Override
- public String getQuestionnaireData() {
- return questionnaireData;
- }
-
- @Override
- public void setQuestionnaireData(String questionnaireData) {
- this.questionnaireData = questionnaireData;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- @Override
public String getEntityType() {
return ENTITY_TYPE;
}
@@ -114,26 +85,6 @@ public class DeploymentFlavorEntity implements CompositionEntity{
return getVspId();
}
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public Version getVersion() {
- return version;
- }
-
- @Override
- public void setVersion(Version version) {
- this.version = version;
- }
-
public DeploymentFlavor getDeploymentFlavorCompositionData() {
return compositionData == null ? null : JsonUtil.json2Object(compositionData, DeploymentFlavor.class);
}
@@ -141,43 +92,4 @@ public class DeploymentFlavorEntity implements CompositionEntity{
public void setDeploymentFlavorCompositionData(DeploymentFlavor deploymentFlavor) {
this.compositionData = deploymentFlavor == null ? null : JsonUtil.object2Json(deploymentFlavor);
}
-
- @Override
- public int hashCode() {
- int result = vspId != null ? vspId.hashCode() : 0;
- result = 31 * result + (version != null ? version.hashCode() : 0);
- result = 31 * result + (id != null ? id.hashCode() : 0);
- result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0);
- result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0);
- return result;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object == null || getClass() != object.getClass()) {
- return false;
- }
-
- DeploymentFlavorEntity that = (DeploymentFlavorEntity) object;
-
- if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
- return false;
- }
- if (version != null ? !version.equals(that.version) : that.version != null) {
- return false;
- }
- if (id != null ? !id.equals(that.id) : that.id != null) {
- return false;
- }
- if (compositionData != null ? !compositionData.equals(that.compositionData)
- : that.compositionData != null) {
- return false;
- }
- return questionnaireData != null ? questionnaireData.equals(that.questionnaireData)
- : that.questionnaireData == null;
-
- }
}