summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main/java/org
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-06-19 13:53:06 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-07-05 09:21:17 +0000
commit70975c212b58b793d3893e131a3d23d8144f5df9 (patch)
tree320721c50bb0e54030a52c3959a8133642811721 /catalog-dao/src/main/java/org
parent0625050758c4f999167ef74a22e994fbd356195f (diff)
Reduce usage of outdated library JMockit (catalog-dao)
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3379 Change-Id: I6b46049b71eafbfedfd3d40c68c743efff13ef54
Diffstat (limited to 'catalog-dao/src/main/java/org')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java33
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java6
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java35
3 files changed, 16 insertions, 58 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
index 7e64605228..ff40d06fc5 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
@@ -21,14 +21,16 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables;
import com.datastax.driver.core.DataType;
import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
@Override
- protected void updateColumnDistribDescription(Map<String, ImmutablePair<DataType, Boolean>> columns) {
- for (DSEFieldsDescription field : DSEFieldsDescription.values()) {
+ protected void updateColumnDistribDescription(final Map<String, ImmutablePair<DataType, Boolean>> columns) {
+ for (final DSEFieldsDescription field : DSEFieldsDescription.values()) {
columns.put(field.getName(), new ImmutablePair<>(field.type, field.indexed));
}
}
@@ -38,7 +40,9 @@ public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
return AuditingTypesConstants.DISTRIBUTION_STATUS_EVENT_TYPE;
}
- enum DSEFieldsDescription {
+ @Getter
+ @AllArgsConstructor
+ private enum DSEFieldsDescription {
// @formatter:off
DID("did", DataType.varchar(), true),
CONSUMER_ID("consumer_id", DataType.varchar(), false),
@@ -47,26 +51,9 @@ public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
STATUS_TIME("status_time", DataType.varchar(), false);
// @formatter:on
- 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;
- }
}
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
index ebcb1d5271..8153d44be7 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
@@ -139,10 +139,4 @@ public final class JsonUtil {
return mapper.readValue(json, type);
}
- public static <T> List<T> toList(String json, Class<T> elementClass, Class<?> elementGenericClass) throws IOException {
- ObjectMapper mapper = getOneObjectMapper();
- JavaType elementType = mapper.getTypeFactory().constructParametricType(elementClass, elementGenericClass);
- JavaType listType = mapper.getTypeFactory().constructCollectionType(List.class, elementType);
- return mapper.readValue(json, listType);
- }
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
index 229d774222..f4f92941c7 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
@@ -21,10 +21,16 @@ package org.openecomp.sdc.be.resources.data;
import java.util.HashMap;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
import org.openecomp.sdc.be.dao.graph.datatype.GraphNode;
import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
+@Getter
+@Setter
+@ToString
public abstract class CategoryData extends GraphNode {
private String name;
@@ -59,38 +65,9 @@ public abstract class CategoryData extends GraphNode {
return map;
}
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getNormalizedName() {
- return normalizedName;
- }
-
- public void setNormalizedName(String normalizedName) {
- this.normalizedName = normalizedName;
- }
-
- @Override
- public String toString() {
- return "CategoryData [name=" + name + ", normalizedName=" + normalizedName + "uniqueId=" + uniqueId + "]";
- }
-
@Override
public String getUniqueIdKey() {
return GraphPropertiesDictionary.UNIQUE_ID.getProperty();
}
- @Override
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
}