aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-02-27 12:55:48 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2021-02-27 12:57:42 +0000
commit8677823abd3fc36120fb50a45cb71b9c4e0fdbf5 (patch)
tree439d5e78c1a85e709e73cb481748fd6cff81e268 /catalog-model
parent4a6db2ebeb5c87cbe6cb71bdacd9c86b5181bdcb (diff)
Improve test coverage
- remove unused code - use lombok Change-Id: I7f6591785243ecb866f4c4b2cf428ae8f3c5172b Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3490
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java20
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java28
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java13
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java5
4 files changed, 0 insertions, 66 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
index a27989bc9e..c2cd29d76f 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
@@ -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()) {
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
index 8c8245e87f..bb3b3b8cf2 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
@@ -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;
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java
index 61c7e0c13e..d03d989fb9 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperation.java
@@ -148,19 +148,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.
*
* 1. Add capability type node
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
index e5901fb998..419adb8b70 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
@@ -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();