Improve test coverage 37/118637/1
authorvasraz <vasyl.razinkov@est.tech>
Sat, 27 Feb 2021 12:55:48 +0000 (12:55 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Sat, 27 Feb 2021 12:57:42 +0000 (12:57 +0000)
- remove unused code
- use lombok

Change-Id: I7f6591785243ecb866f4c4b2cf428ae8f3c5172b
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3490

22 files changed:
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ArtifactTableDescription.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/AuthEventTableDescription.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribBaseEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDownloadEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribEngineEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribNotifEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/EcompOperationalEnvironmentEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/FeatureToggleEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescription.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDesc.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OperationalEnvironmentsTableDescription.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/SdcSchemaFilesTableDescription.java
catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAccessEventTableDescription.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java

index 5a7ebb4..128fd9d 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -60,30 +62,15 @@ public class ArtifactTableDescription implements ITableDescription {
                return "resources";
        }
 
+       @Getter
+       @AllArgsConstructor
        enum ArtifactFieldsDescription {
                DATA("data", DataType.blob(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               ArtifactFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
        @Override
index c0218fd..a2b6534 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -66,6 +68,8 @@ public class AuthEventTableDescription implements ITableDescription {
                return AuditingTypesConstants.AUTH_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum AEFieldsDescription {
                URL("url", DataType.varchar(), false), 
                REQUEST_ID("request_id", DataType.varchar(), true), 
@@ -76,27 +80,10 @@ public class AuthEventTableDescription implements ITableDescription {
                STATUS("status", DataType.varchar(), false), 
                DESC("description", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               AEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 81d882e..68d2373 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -63,7 +65,8 @@ public abstract class DistribBaseEventTableDesc implements ITableDescription {
 
     protected abstract void updateColumnDistribDescription(final Map<String, ImmutablePair<DataType, Boolean>> columns);
 
-
+    @Getter
+    @AllArgsConstructor
     enum DistFieldsDescription {
         ACTION("action", DataType.varchar(), true),
         STATUS("status", DataType.varchar(), false),
@@ -71,26 +74,9 @@ public abstract class DistribBaseEventTableDesc implements ITableDescription {
         REQUEST_ID("request_id", DataType.varchar(), false),
         SERVICE_INST_ID("service_instance_id", DataType.varchar(), false);
 
-        private String name;
-        private DataType type;
-        private boolean indexed;
-
-        DistFieldsDescription(String name, DataType type, boolean indexed) {
-            this.name = name;
-            this.type = type;
-            this.indexed = indexed;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public DataType getType() {
-            return type;
-        }
+        private final String name;
+        private final DataType type;
+        private final boolean indexed;
 
-        public boolean isIndexed() {
-            return indexed;
-        }
     }
 }
index fefe553..32e5e49 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
 
@@ -28,7 +30,6 @@ import java.util.Map;
 
 public class DistribDeployEventTableDesc extends DistribBaseEventTableDesc {
 
-
        @Override
        public String getTableName() {
                return AuditingTypesConstants.DISTRIBUTION_DEPLOY_EVENT_TYPE;
@@ -47,6 +48,8 @@ public class DistribDeployEventTableDesc extends DistribBaseEventTableDesc {
 
     }
 
+       @Getter
+       @AllArgsConstructor
        enum DSEFieldsDescription {
                MODIFIER("modifier", DataType.varchar(), false),
                CURR_VERSION("curr_version", DataType.varchar(), false), 
@@ -54,27 +57,10 @@ public class DistribDeployEventTableDesc extends DistribBaseEventTableDesc {
                RESOURCE_NAME("resource_name", DataType.varchar(), false), 
                RESOURCE_TYPE("resource_type", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
-
-               DSEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 5dc1834..f59347d 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
 
@@ -40,31 +42,16 @@ public class DistribDownloadEventTableDesc extends DistribBaseEventTableDesc {
                return AuditingTypesConstants.DISTRIBUTION_DOWNLOAD_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DSEFieldsDescription {
                CONSUMER_ID("consumer_Id", DataType.varchar(), false),
                RESOURCE_URL("resource_URL", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DSEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 84ebf0b..650aa9b 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
 
@@ -44,6 +46,8 @@ public class DistribEngineEventTableDesc extends DistribBaseEventTableDesc {
                return AuditingTypesConstants.DISTRIBUTION_ENGINE_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DEEFieldsDescription {
                CONSUMER_ID("consumer_id", DataType.varchar(), false),
                ROLE("role", DataType.varchar(), false),
@@ -52,27 +56,10 @@ public class DistribEngineEventTableDesc extends DistribBaseEventTableDesc {
                DSTATUS_TOPIC("dstatus_topic", DataType.varchar(), false), 
                DNOTIF_TOPIC("dnotif_topic", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DEEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index ec9cf21..612a0b5 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
 
@@ -43,6 +45,8 @@ public class DistribNotifEventTableDesc extends DistribBaseEventTableDesc {
                return AuditingTypesConstants.DISTRIBUTION_NOTIFICATION_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DNEFieldsDescription {
                TOPIC_NAME("topic_name", DataType.varchar(), false),
                MODIFIER("modifier", DataType.varchar(), false), 
@@ -55,27 +59,10 @@ public class DistribNotifEventTableDesc extends DistribBaseEventTableDesc {
                VNF_WORKLOAD_CONTEXT("vnf_workload_context", DataType.varchar(), false),
                TENANT("tenant", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DNEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index de13daf..eac2a70 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -64,6 +66,8 @@ public class EcompOperationalEnvironmentEventTableDesc implements ITableDescript
         return AuditingTypesConstants.ECOMP_OPERATIONAL_ENV_EVENT_TYPE;
     }
 
+    @Getter
+    @AllArgsConstructor
     enum EcompOpEnvFieldsDescription {
         ACTION("action", DataType.varchar(), false),
         OPERATIONAL_ENVIRONMENT_NAME("operational_environment_name", DataType.varchar(), false),
@@ -71,26 +75,9 @@ public class EcompOperationalEnvironmentEventTableDesc implements ITableDescript
         OPERATIONAL_ENVIRONMENT_ACTION("operational_environment_action", DataType.varchar(), false),
         TENANT_CONTEXT("tenant_context", DataType.varchar(), false);
 
-        private String name;
-        private DataType type;
-        private boolean indexed;
+        private final String name;
+        private final DataType type;
+        private final boolean indexed;
 
-        EcompOpEnvFieldsDescription(String name, DataType type, boolean indexed) {
-            this.name = name;
-            this.type = type;
-            this.indexed = indexed;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public DataType getType() {
-            return type;
-        }
-
-        public boolean isIndexed() {
-            return indexed;
-        }
     }
 }
index 4a88232..659bec7 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -66,6 +68,8 @@ public class ExternalApiEventTableDesc implements ITableDescription {
                return AuditingTypesConstants.EXTERNAL_API_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum EGAEFieldsDescription {
                ACTION("action", DataType.varchar(), true), 
                STATUS("status", DataType.varchar(), false), 
@@ -85,27 +89,10 @@ public class ExternalApiEventTableDesc implements ITableDescription {
                CURR_ARTIFACT_UUID( "curr_artifact_uuid", DataType.varchar(), false),
                ARTIFACT_DATA( "artifact_data", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               EGAEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 4c18f98..ed79f4b 100644 (file)
@@ -22,6 +22,8 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
 import com.google.common.collect.Lists;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -66,32 +68,16 @@ public class FeatureToggleEventTableDesc implements ITableDescription {
         return AuditingTypesConstants.FEATURE_TOGGLE_STATE;
     }
 
+    @Getter
+    @AllArgsConstructor
     enum FeatureToggleEventFieldsDescription {
         ENABLED("enabled", DataType.varchar(), false),
         STRATEGY_ID("strategy_id", DataType.varchar(), false),
         PARAMETERS("parameters", DataType.varchar(), false);
 
-        private String name;
-        private DataType type;
-        private boolean indexed;
-
-        FeatureToggleEventFieldsDescription(String name, DataType type, boolean indexed) {
-            this.name = name;
-            this.type = type;
-            this.indexed = indexed;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public DataType getType() {
-            return type;
-        }
-
-        public boolean isIndexed() {
-            return indexed;
-        }
+        private final String name;
+        private final DataType type;
+        private final boolean indexed;
 
     }
 }
index e186fd2..5765cb5 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -66,6 +68,8 @@ public class GetCatHierEventTableDesc implements ITableDescription {
                return AuditingTypesConstants.GET_CATEGORY_HIERARCHY_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DEEFieldsDescription {
                ACTION("action", DataType.varchar(), true), 
                STATUS("status", DataType.varchar(), false), 
@@ -74,27 +78,10 @@ public class GetCatHierEventTableDesc implements ITableDescription {
                REQUEST_ID("request_id", DataType.varchar(), false), 
                MODIFIER("modifier", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DEEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 461c9b7..ce2a8e9 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -67,6 +69,8 @@ public class GetUebClusterEventTableDesc implements ITableDescription {
                return AuditingTypesConstants.DISTRIBUTION_GET_UEB_CLUSTER_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DEEFieldsDescription {
                ACTION("action", DataType.varchar(), true), 
                STATUS("status", DataType.varchar(), false), 
@@ -75,27 +79,10 @@ public class GetUebClusterEventTableDesc implements ITableDescription {
                REQUEST_ID("request_Id", DataType.varchar(), false), 
                SERVICE_INST_ID("service_Instance_Id", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DEEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 9d1bb45..3c3ebe7 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -66,6 +68,8 @@ public class GetUsersListEventTableDesc implements ITableDescription {
                return AuditingTypesConstants.GET_USERS_LIST_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum DEEFieldsDescription {
                ACTION("action", DataType.varchar(), true), 
                STATUS("status", DataType.varchar(), false), 
@@ -74,27 +78,10 @@ public class GetUsersListEventTableDesc implements ITableDescription {
                REQUEST_ID("request_id", DataType.varchar(), false), 
                MODIFIER("modifier", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               DEEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index fb741b1..54656cb 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -63,6 +65,8 @@ public class MigrationTasksTableDescription implements ITableDescription {
         return MIGRATION_TASKS_TABLE;
     }
 
+    @Getter
+    @AllArgsConstructor
     enum SdcRepoFieldsDescription {
         MAJOR_VERSION("major_version", DataType.bigint(), true),
         MINOR_VERSION("minor_version", DataType.bigint(), false),
@@ -73,26 +77,9 @@ public class MigrationTasksTableDescription implements ITableDescription {
         DESCRIPTION("description", DataType.varchar(), false),
         EXECUTION_TIME("execution_time", DataType.cdouble(), false);
 
-        private String fieldName;
-        private boolean isIndexed;
-        private DataType fieldType;
+        private final String fieldName;
+        private final DataType fieldType;
+        private final boolean isIndexed;
 
-        SdcRepoFieldsDescription(String fieldName, DataType dataType, boolean indexed ) {
-            this.fieldName = fieldName;
-            this.fieldType = dataType;
-            this.isIndexed = indexed;
-        }
-
-        public String getFieldName() {
-            return fieldName;
-        }
-
-        public boolean isIndexed() {
-            return isIndexed;
-        }
-
-        public DataType getFieldType() {
-            return fieldType;
-        }
     }
 }
index c80d99e..f69b3ce 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -68,6 +70,8 @@ public class OldExternalApiEventTableDesc implements ITableDescription {
                return AuditingTypesConstants.EXTERNAL_API_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum EGAEFieldsDescription {
                ACTION("action", DataType.varchar(), true), 
                STATUS("status", DataType.varchar(), false), 
@@ -87,27 +91,10 @@ public class OldExternalApiEventTableDesc implements ITableDescription {
                CURR_ARTIFACT_UUID( "curr_artifact_uuid", DataType.varchar(), false),
                ARTIFACT_DATA( "artifact_data", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               EGAEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index 61d0a8b..f924d17 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -63,6 +65,8 @@ public class OperationalEnvironmentsTableDescription implements ITableDescriptio
         return OPERATIONAL_ENVIRONMENT_TABLE;
     }
 
+    @Getter
+    @AllArgsConstructor
     enum SdcOperationalEnvironmentFieldsDescription {
         //there is also PK field "environmentID"
         TENANT("tenant", DataType.varchar(), false),
@@ -74,26 +78,9 @@ public class OperationalEnvironmentsTableDescription implements ITableDescriptio
         STATUS("status",DataType.varchar() ,true),
         LAST_MODIFIED("last_modified",DataType.timestamp() ,false);
 
-        private String fieldName;
-        private boolean isIndexed;
-        private DataType fieldType;
+        private final String fieldName;
+        private final DataType fieldType;
+        private final boolean isIndexed;
 
-        SdcOperationalEnvironmentFieldsDescription(String fieldName, DataType dataType, boolean indexed ) {
-            this.fieldName = fieldName;
-            this.fieldType = dataType;
-            this.isIndexed = indexed;
-        }
-
-        public String getFieldName() {
-            return fieldName;
-        }
-
-        public boolean isIndexed() {
-            return isIndexed;
-        }
-
-        public DataType getFieldType() {
-            return fieldType;
-        }
     }
 }
index 8f740c1..b2fd87a 100644 (file)
@@ -21,6 +21,8 @@
 package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
 import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
@@ -71,32 +73,17 @@ public class SdcSchemaFilesTableDescription implements ITableDescription {
        public String getTableName() {
                return "sdcSchemaFiles";  
        }
-       
+
+       @Getter
+       @AllArgsConstructor
        enum SdcSchemaFilesFieldsDescription {
                FILE_NAME("fileName", DataType.varchar(), false),
                PAYLOAD("payload", DataType.blob(), false),
                CHECKSUM("checksum", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               SdcSchemaFilesFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 }
index 4e778b8..5186c7e 100644 (file)
@@ -22,14 +22,15 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables;
 
 import com.datastax.driver.core.DataType;
 import com.datastax.driver.mapping.annotations.Column;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
 
 public class UserAccessEventTableDescription implements ITableDescription {
        @Override
@@ -67,36 +68,20 @@ public class UserAccessEventTableDescription implements ITableDescription {
                return AuditingTypesConstants.USER_ACCESS_EVENT_TYPE;
        }
 
+       @Getter
+       @AllArgsConstructor
        enum UAEFieldsDescription {
-               REQUEST_ID("request_Id", DataType.varchar(), false), USER("USER", DataType.varchar(), false), ACTION("action",
-                               DataType.varchar(), true), STATUS("status", DataType.varchar(), false), DESCRIPTION("description",
-                                               DataType.varchar(),
-                                               false), SERVICE_INSTANCE_ID("service_instance_id", DataType.varchar(), false);
-
-               @Column
-               private String modifier;
+               REQUEST_ID("request_Id", DataType.varchar(), false),
+               USER("USER", DataType.varchar(), false),
+               ACTION("action", DataType.varchar(), true),
+               STATUS("status", DataType.varchar(), false),
+               DESCRIPTION("description", DataType.varchar(), false),
+               SERVICE_INSTANCE_ID("service_instance_id", DataType.varchar(), false);
 
-               private String name;
-               private DataType type;
-               private boolean indexed;
+               private final String name;
+               private final DataType type;
+               private final boolean indexed;
 
-               UAEFieldsDescription(String name, DataType type, boolean indexed) {
-                       this.name = name;
-                       this.type = type;
-                       this.indexed = indexed;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public DataType getType() {
-                       return type;
-               }
-
-               public boolean isIndexed() {
-                       return indexed;
-               }
        }
 
 }
index a27989b..c2cd29d 100644 (file)
@@ -215,13 +215,6 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
         return associateForwardingPathToComponent(topologyTemplateVertex,forwardingPaths);
     }
 
-    private StorageOperationStatus associateNodeFilterToResource(GraphVertex topologyTemplateVertex,
-            TopologyTemplate topologyTemplate) {
-        Map<String, CINodeFilterDataDefinition> nodeFilters =
-                topologyTemplate.getNodeFilterComponents();
-        return associateNodeFiltersToComponent(topologyTemplateVertex, nodeFilters);
-    }
-
     private StorageOperationStatus associateCapPropertiesToResource(GraphVertex topologyTemplateVertex, TopologyTemplate topologyTemplate) {
         Map<String, MapCapabilityProperty> calculatedCapProperties = topologyTemplate
                 .getCalculatedCapabilitiesProperties();
@@ -887,19 +880,6 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
         return StorageOperationStatus.OK;
     }
 
-    public StorageOperationStatus associateNodeFiltersToComponent(GraphVertex nodeTypeVertex,
-            Map<String, CINodeFilterDataDefinition> filterMaps) {
-        if (filterMaps != null && !filterMaps.isEmpty()) {
-            Either<GraphVertex, StorageOperationStatus> assosiateElementToData = associateElementToData
-                                                                                         (nodeTypeVertex, VertexTypeEnum.NODE_FILTER_TEMPLATE,
-                                                                                                 EdgeLabelEnum.NODE_FILTER_TEMPLATE, filterMaps);
-            if (assosiateElementToData.isRight()) {
-                return assosiateElementToData.right().value();
-            }
-        }
-        return StorageOperationStatus.OK;
-    }
-
     private JanusGraphOperationStatus setForwardingGraphPropertiesFromGraph(GraphVertex componentV, TopologyTemplate topologyTemplate) {
         Either<Map<String, ForwardingPathDataDefinition>, JanusGraphOperationStatus> result = getDataFromGraph(componentV, EdgeLabelEnum.FORWARDING_PATH);
         if (result.isLeft()) {
index 8c8245e..bb3b3b8 100644 (file)
@@ -993,34 +993,6 @@ public abstract class ToscaElementOperation extends BaseOperation {
         return dataType;
     }
 
-    private Map<String, AttributeDataDefinition> getAttributesFromComponentV(final GraphVertex componentV) {
-        final Map<String, Object> jsonMetada = componentV.getMetadataJson();
-        final Map<String, AttributeDataDefinition> attributeDataDefinitionMap = new HashMap<>();
-        if (MapUtils.isNotEmpty(jsonMetada)) {
-            final Object attributes = jsonMetada.get(ToscaTagNamesEnum.ATTRIBUTES.getElementName());
-            if (attributes instanceof Map) {
-                final Map<String, Object> map = (Map<String, Object>) attributes;
-                attributeDataDefinitionMap.putAll(map.values().stream().map(attributeMap -> {
-                    final AttributeDataDefinition attributeDef = new AttributeDataDefinition();
-                    final String name = (String) ((Map<String, Object>) attributeMap).get("name");
-                    attributeDef.setName(name);
-                    final String type = (String) ((Map<String, Object>) attributeMap).get("type");
-                    attributeDef.setType(type);
-                    final String description = (String) ((Map<String, Object>) attributeMap).get("description");
-                    attributeDef.setDescription(description);
-                    final Object _default = ((Map<String, Object>) attributeMap).get("_default");
-                    attributeDef.set_default(_default);
-                    final String status = (String) ((Map<String, Object>) attributeMap).get("status");
-                    attributeDef.setStatus(status);
-                    final EntrySchema entry_schema = (EntrySchema) ((Map<String, Object>) attributeMap).get("entry_schema");
-                    attributeDef.setEntry_schema(entry_schema);
-                    return attributeDef;
-                }).collect(Collectors.toMap(AttributeDataDefinition::getName, a -> a)));
-            }
-        }
-        return attributeDataDefinitionMap;
-    }
-
     protected JanusGraphOperationStatus setResourceCategoryFromGraphV(Vertex vertex, CatalogComponent catalogComponent) {
         List<CategoryDefinition> categories = new ArrayList<>();
         SubCategoryDefinition subcategory;
index 61c7e0c..d03d989 100644 (file)
@@ -146,19 +146,6 @@ public class CapabilityTypeOperation extends AbstractOperation implements ICapab
     }
     
 
-    /**
-     *
-     * convert between graph Node object to Java object
-     *
-     * @param capabilityTypeData
-     * @return
-     */
-    protected CapabilityTypeDefinition convertCTDataToCTDefinition(CapabilityTypeData capabilityTypeData) {
-        log.debug("The object returned after create capability is {}", capabilityTypeData);
-
-        return new CapabilityTypeDefinition(capabilityTypeData.getCapabilityTypeDataDefinition());
-    }
-
     /**
      *
      * Add capability type to graph.
index e5901fb..419adb8 100644 (file)
@@ -2010,11 +2010,6 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe
                return result;
        }
 
-       private Either<DataTypeDefinition, JanusGraphOperationStatus> getDataTypeUsingName(String name) {
-               String uid = UniqueIdBuilder.buildDataTypeUid(name);
-               return getDataTypeByUid(uid);
-       }
-
        public Either<String, JanusGraphOperationStatus> checkInnerType(PropertyDataDefinition propDataDef) {
 
                String propertyType = propDataDef.getType();