summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-11-15 12:27:54 +0000
committerMichael Morris <michael.morris@est.tech>2021-11-22 09:46:54 +0000
commitf0d4dd5c846f1c56d8b2641934c028b8151b31b3 (patch)
tree720f5e350dd5a6eba6f14eacfc73a7a209f668ab /catalog-be/src/main
parent86671624c83f8d6af7523d1527858e9f93b35f11 (diff)
Fix test cases failing incorrectly
https://gerrit.onap.org/r/c/sdc/+/124980 Change-Id: I9fbd8a0b5b83d04928feea7624e593b45441ac9b Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3757
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
index b668ae7efc..3531fe786b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ForwardingPathToscaUtil.java
@@ -28,6 +28,8 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
@@ -40,10 +42,7 @@ import org.openecomp.sdc.be.tosca.CapabilityRequirementConverter;
import org.openecomp.sdc.be.tosca.model.ToscaNodeTemplate;
import org.openecomp.sdc.be.tosca.model.ToscaTemplateRequirement;
-/**
- * @author KATYR
- * @since November 19, 2017
- */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ForwardingPathToscaUtil {
public static final String FORWARDS_TO_TOSCA_NAME = "org.openecomp.relationships.ForwardsTo";
@@ -97,8 +96,9 @@ public class ForwardingPathToscaUtil {
}
private static String fetchNodeName(Service service, String nodeId) {
- if (service.getComponentInstanceByName(nodeId).isPresent()) {
- return service.getComponentInstanceByName(nodeId).get().getName();
+ final Optional<ComponentInstance> componentInstanceByName = service.getComponentInstanceByName(nodeId);
+ if (componentInstanceByName.isPresent()) {
+ return componentInstanceByName.get().getName();
} else {
return "";
}