summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-model/src/main')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java2
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
index 22548dbf92..f75c7a6b06 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
@@ -1497,7 +1497,7 @@ public class NodeTemplateOperation extends BaseOperation {
String instanceNewName, boolean generateUid,
ToscaElement originToscaElement) {
String ciOriginComponentUid = resourceInstance.getComponentUid();
- if (!ValidationUtils.validateStringNotEmpty(resourceInstance.getCustomizationUUID())) {
+ if (StringUtils.isEmpty(resourceInstance.getCustomizationUUID())) {
resourceInstance.setCustomizationUUID(generateCustomizationUUID());
}
ComponentInstanceDataDefinition dataDefinition = new ComponentInstanceDataDefinition(resourceInstance);
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 13729bf0b1..24e1e910d3 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
@@ -39,6 +39,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -475,10 +476,11 @@ public abstract class ToscaElementOperation extends BaseOperation {
protected StorageOperationStatus associateComponentToModel(final GraphVertex nodeTypeVertex, final ToscaElement nodeType,
final EdgeLabelEnum edgeLabelEnum) {
- if (nodeType.getMetadataValue(JsonPresentationFields.MODEL) == null) {
+ Object metadataValue = nodeType.getMetadataValue(JsonPresentationFields.MODEL);
+ if (metadataValue == null || StringUtils.isEmpty((String) metadataValue)) {
return StorageOperationStatus.OK;
}
- final String model = ((String) nodeType.getMetadataValue(JsonPresentationFields.MODEL));
+ final String model = ((String) metadataValue);
final JanusGraphOperationStatus createEdge = janusGraphDao.createEdge(getModelVertex(model), nodeTypeVertex, edgeLabelEnum, new HashMap<>());
if (createEdge != JanusGraphOperationStatus.OK) {
log.trace("Failed to associate resource {} to model {}", nodeType.getUniqueId(), model);