Improve test coverage 21/119321/5
authorxuegao <xue.gao@intl.att.com>
Mon, 15 Mar 2021 13:10:57 +0000 (14:10 +0100)
committerChristophe Closset <christophe.closset@intl.att.com>
Tue, 16 Mar 2021 13:31:41 +0000 (13:31 +0000)
Use Lombok annotations to improve test coverage.

Issue-ID: SDC-3428
Change-Id: I78a9fa6171ba26e431b5e587b24548322c464ecc
Signed-off-by: xuegao <xue.gao@intl.att.com>
13 files changed:
catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/DAOArtifactData.java
openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/type/ItemPermissionsEntity.java
openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java
openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java
openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/OpenEcompComponentEntity.java
openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/test/java/org/openecomp/sdc/action/dao/types/ActionEntityTest.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityLogEntity.java
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
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
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
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
openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java
openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java

index 28a5d35..2b79c2d 100644 (file)
@@ -24,9 +24,14 @@ import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
 import com.datastax.driver.mapping.annotations.Transient;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 import java.nio.ByteBuffer;
 
+@Getter
+@NoArgsConstructor
 @Table(keyspace = "sdcartifact", name = "resources")
 public class DAOArtifactData {
        public static final String RRESOURCE_ID_FIELD = "resourceId";
@@ -39,6 +44,7 @@ public class DAOArtifactData {
 
        @PartitionKey
        @Column(name = "id")
+       @Setter
        private String id;
 
        /*
@@ -48,11 +54,6 @@ public class DAOArtifactData {
        @Column
        private ByteBuffer data;
 
-       // private byte[] data;
-
-       public DAOArtifactData() {
-
-       }
 
        public DAOArtifactData(String id) {
 
@@ -85,24 +86,10 @@ public class DAOArtifactData {
                }
        }
 
-       public ByteBuffer getData() {
-               // return data;
-               return data;
-       }
-
        public void setData(ByteBuffer data) {
                if (data != null) {
                        // this.data = data.clone();
                        this.data = data.duplicate();
                }
        }
-
-       public String getId() {
-               return id;
-       }
-
-       public void setId(String id) {
-               this.id = id;
-       }
-
 }
index 3279f02..81ad393 100644 (file)
@@ -23,11 +23,17 @@ import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 /**
  * Created by ayalaben on 6/18/2017.
  */
 
+@Getter
+@Setter
+@NoArgsConstructor
 @Table(keyspace = "dox", name = "item_permissions")
 public class ItemPermissionsEntity {
 
@@ -41,29 +47,4 @@ public class ItemPermissionsEntity {
 
   @Column(name = "permission")
   private String permission;
-
-
-  public String getItemId() {
-    return itemId;
-  }
-
-  public void setItemId(String itemId) {
-    this.itemId = itemId;
-  }
-
-  public String getUserId() {
-    return userId;
-  }
-
-  public void setUserId(String userId) {
-    this.userId = userId;
-  }
-
-  public String getPermission() {
-    return permission;
-  }
-
-  public void setPermission(String permission) {
-    this.permission = permission;
-  }
 }
index bc34b8d..bd6a978 100644 (file)
@@ -23,10 +23,16 @@ package org.openecomp.sdc.action.dao.types;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.openecomp.sdc.action.types.ActionArtifact;
 
 import java.nio.ByteBuffer;
 
+@Getter
+@Setter
+@NoArgsConstructor
 @Table(keyspace = "dox", name = "action_artifact")
 public class ActionArtifactEntity {
 
@@ -41,44 +47,11 @@ public class ActionArtifactEntity {
   @Column(name = "artifact")
   private ByteBuffer artifact;
 
-  /**
-   * 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 ActionArtifactEntity() {
-    // Don't delete! Default constructor is required by DataStax driver
-  }
-
   public ActionArtifactEntity(String artifactUuId, int effectiveVersion) {
     this.artifactUuId = artifactUuId;
     this.effectiveVersion = effectiveVersion;
   }
 
-  public String getArtifactUuId() {
-    return artifactUuId;
-  }
-
-  public void setArtifactUuId(String artifactUuId) {
-    this.artifactUuId = artifactUuId;
-  }
-
-  public int getEffectiveVersion() {
-    return effectiveVersion;
-  }
-
-  public void setEffectiveVersion(int effectiveVersion) {
-    this.effectiveVersion = effectiveVersion;
-  }
-
-  public ByteBuffer getArtifact() {
-    return artifact;
-  }
-
-  public void setArtifact(ByteBuffer artifact) {
-    this.artifact = artifact;
-  }
-
   /**
    * To dto action artifact.
    *
index 17f6dea..d84d560 100644 (file)
@@ -25,11 +25,16 @@ import java.util.Date;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.action.types.Action;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-
+@Getter
+@Setter
+@NoArgsConstructor
 @Table(keyspace = "dox", name = "Action")
 public class ActionEntity {
 
@@ -61,64 +66,11 @@ public class ActionEntity {
   @Column(name = "data")
   private String data;
 
-  /**
-   * 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 ActionEntity() {
-    // Don't delete! Default constructor is required by DataStax driver
-  }
-
   public ActionEntity(String actionInvariantUuId, Version version) {
     this.actionInvariantUuId = actionInvariantUuId;
     this.version = version;
   }
 
-  public String getActionUuId() {
-    return actionUuId;
-  }
-
-  public void setActionUuId(String actionUuId) {
-    this.actionUuId = actionUuId;
-  }
-
-  public String getActionInvariantUuId() {
-    return actionInvariantUuId;
-  }
-
-  public void setActionInvariantUuId(String actionInvariantUuId) {
-    this.actionInvariantUuId = actionInvariantUuId;
-  }
-
-  public Version getVersion() {
-    return version;
-  }
-
-  public void setVersion(Version version) {
-    this.version = version;
-  }
-
-  public String getStatus() {
-    return status;
-  }
-
-  public void setStatus(String status) {
-    this.status = status;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public Set<String> getVendorList() {
-    return vendorList;
-  }
-
   /**
    * Sets vendor list.
    *
@@ -129,10 +81,6 @@ public class ActionEntity {
                               vendorList.stream().map(String::toLowerCase).collect(Collectors.toSet()) : vendorList;
   }
 
-  public Set<String> getCategoryList() {
-    return categoryList;
-  }
-
   /**
    * Sets category list.
    *
@@ -144,46 +92,6 @@ public class ActionEntity {
                                 categoryList;
   }
 
-  public Date getTimestamp() {
-    return timestamp;
-  }
-
-  public void setTimestamp(Date timestamp) {
-    this.timestamp = timestamp;
-  }
-
-  public String getUser() {
-    return user;
-  }
-
-  public void setUser(String user) {
-    this.user = user;
-  }
-
-  public Set<String> getSupportedModels() {
-    return supportedModels;
-  }
-
-  public void setSupportedModels(Set<String> supportedModels) {
-    this.supportedModels = supportedModels;
-  }
-
-  public Set<String> getSupportedComponents() {
-    return supportedComponents;
-  }
-
-  public void setSupportedComponents(Set<String> supportedComponents) {
-    this.supportedComponents = supportedComponents;
-  }
-
-  public String getData() {
-    return data;
-  }
-
-  public void setData(String data) {
-    this.data = data;
-  }
-
   /**
    * To dto action.
    *
index a5025e5..f8380a9 100644 (file)
@@ -23,8 +23,16 @@ package org.openecomp.sdc.action.dao.types;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.openecomp.sdc.action.types.OpenEcompComponent;
 
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
 @Table(keyspace = "dox", name = "EcompComponent")
 public class OpenEcompComponentEntity {
 
@@ -35,35 +43,6 @@ public class OpenEcompComponentEntity {
   @Column(name = "name")
   private String name;
 
-  /**
-   * 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 OpenEcompComponentEntity() {
-    // Don't delete! Default constructor is required by DataStax driver
-  }
-
-  public OpenEcompComponentEntity(String id, String name) {
-    this.id = id;
-    this.name = name;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
 
   /**
    * To dto OPENECOMP component.
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/test/java/org/openecomp/sdc/action/dao/types/ActionEntityTest.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/test/java/org/openecomp/sdc/action/dao/types/ActionEntityTest.java
new file mode 100644 (file)
index 0000000..3fbecb4
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.types;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+
+public class ActionEntityTest {
+
+  @Test
+  public void TestSetVendorList() {
+    ActionEntity entity = new ActionEntity();
+
+    entity.setVendorList(null);
+    assertEquals(null, entity.getVendorList());
+
+    Set<String> stringSet = new HashSet<>();
+    entity.setVendorList(stringSet);
+    assertEquals(stringSet, entity.getVendorList());
+
+    stringSet.add("TesT");
+    entity.setVendorList(stringSet);
+    assertEquals("test", entity.getVendorList().toArray()[0]);
+  }
+
+  @Test
+  public void TestSetCategoryList() {
+    ActionEntity entity = new ActionEntity();
+
+    entity.setCategoryList(null);
+    assertEquals(null, entity.getCategoryList());
+
+    Set<String> stringSet = new HashSet<>();
+    entity.setCategoryList(stringSet);
+    assertEquals(stringSet, entity.getCategoryList());
+
+    stringSet.add("TesT");
+    entity.setCategoryList(stringSet);
+    assertEquals("test", entity.getCategoryList().toArray()[0]);
+  }
+}
\ No newline at end of file
index 3c65624..f878bea 100644 (file)
@@ -20,11 +20,16 @@ import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Date;
 
-
+@Getter
+@Setter
+@NoArgsConstructor
 @Table(keyspace = "dox", name = "activity_log")
 public class ActivityLogEntity {
   @PartitionKey
@@ -43,15 +48,6 @@ public class ActivityLogEntity {
   private String message;
   private String comment;
 
-  /**
-   * 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 ActivityLogEntity() {
-    // Don't delete! Default constructor is required by DataStax driver
-  }
-
   public ActivityLogEntity(String itemId, Version version) {
     this.itemId = itemId;
     this.versionId = version == null ? null : version.getId();
@@ -67,76 +63,4 @@ public class ActivityLogEntity {
     this.comment = comment;
     this.timestamp = new Date();
   }
-
-  public String getItemId() {
-    return itemId;
-  }
-
-  public void setItemId(String itemId) {
-    this.itemId = itemId;
-  }
-
-  public String getVersionId() {
-    return versionId;
-  }
-
-  public void setVersionId(String versionId) {
-    this.versionId = versionId;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  public ActivityType getType() {
-    return type;
-  }
-
-  public void setType(ActivityType type) {
-    this.type = type;
-  }
-
-  public String getUser() {
-    return user;
-  }
-
-  public void setUser(String user) {
-    this.user = user;
-  }
-
-  public Date getTimestamp() {
-    return timestamp;
-  }
-
-  public void setTimestamp(Date timestamp) {
-    this.timestamp = timestamp;
-  }
-
-  public boolean isSuccess() {
-    return success;
-  }
-
-  public void setSuccess(boolean success) {
-    this.success = success;
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-  public void setMessage(String message) {
-    this.message = message;
-  }
-
-  public String getComment() {
-    return comment;
-  }
-
-  public void setComment(String comment) {
-    this.comment = comment;
-  }
 }
index fc569d5..dfdc0bc 100644 (file)
 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;
-  }
 }
index c13ce14..18c4d94 100644 (file)
 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";
@@ -51,15 +58,6 @@ public class ComponentEntity implements CompositionEntity {
   @Transient
   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.
    *
@@ -83,34 +81,6 @@ public class ComponentEntity implements CompositionEntity {
     return new CompositionEntityId(getId(), 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;
-  }
-
   @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;
-
-  }
 }
index 1d3c432..590fca6 100644 (file)
 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;
@@ -74,26 +71,6 @@ public class ComputeEntity 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;
-  }
-
   @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);
index fb28154..dd145b1 100644 (file)
 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";
@@ -45,15 +53,6 @@ public class DeploymentFlavorEntity 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 DeploymentFlavorEntity() {
-        // Don't delete! Default constructor is required by DataStax driver
-    }
-
     /**
      * Instantiates a new DeploymentFlavor entity.
      *
@@ -76,34 +75,6 @@ public class DeploymentFlavorEntity implements CompositionEntity{
         return new CompositionEntityId(getId(), 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;
-    }
-
     @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;
-
-    }
 }
index fe92b39..e5c5412 100644 (file)
@@ -42,11 +42,11 @@ public class HealingHandler {
   public void populateHealingTable(List<HealingEntity> healingEntities) {
     healingEntities.forEach(healingEntity -> {
       if (isHealingRecordExist(healingEntity)) {
-        accessor.updateFlag(healingEntity.getHealingFlag(), healingEntity.getSpace(),
+        accessor.updateFlag(healingEntity.isHealingFlag(), healingEntity.getSpace(),
             healingEntity.getItemId(), healingEntity.getVersionId());
       } else {
         accessor.create(healingEntity.getSpace(), healingEntity.getItemId(),
-            healingEntity.getVersionId(), healingEntity.getHealingFlag(),
+            healingEntity.getVersionId(), healingEntity.isHealingFlag(),
             healingEntity.getOldVersion());
       }
     });
index b25b8fb..155c8e2 100644 (file)
@@ -18,10 +18,18 @@ package org.openecomp.core.tools.store.zusammen.datatypes;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 /**
  * Created by ayalaben on 10/15/2017
  */
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
 @Table(keyspace = "dox", name = "healing")
 public class HealingEntity {
 
@@ -42,62 +50,4 @@ public class HealingEntity {
 
   @Column(name = "old_version")
   private String oldVersion;
-
-  /**
-   * 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 HealingEntity() {
-    // Don't delete! Default constructor is required by DataStax driver
-  }
-
-  public HealingEntity(String space, String itemId, String versionId, boolean healingFlag,
-                       String oldVersion) {
-    this.space = space;
-    this.itemId = itemId;
-    this.versionId = versionId;
-    this.healingFlag = healingFlag;
-    this.oldVersion = oldVersion;
-  }
-
-  public String getSpace() {
-    return space;
-  }
-
-  public void setSpace(String space) {
-    this.space = space;
-  }
-
-  public String getItemId() {
-    return itemId;
-  }
-
-  public void setItemId(String itemId) {
-    this.itemId = itemId;
-  }
-
-  public String getVersionId() {
-    return versionId;
-  }
-
-  public void setVersionId(String versionId) {
-    this.versionId = versionId;
-  }
-
-  public boolean getHealingFlag() {
-    return healingFlag;
-  }
-
-  public void setHealingFlag(boolean healingFlag) {
-    this.healingFlag = healingFlag;
-  }
-
-  public String getOldVersion() {
-    return oldVersion;
-  }
-
-  public void setOldVersion(String oldVersion) {
-    this.oldVersion = oldVersion;
-  }
 }