From f0d4dd5c846f1c56d8b2641934c028b8151b31b3 Mon Sep 17 00:00:00 2001 From: vasraz Date: Mon, 15 Nov 2021 12:27:54 +0000 Subject: Fix test cases failing incorrectly https://gerrit.onap.org/r/c/sdc/+/124980 Change-Id: I9fbd8a0b5b83d04928feea7624e593b45441ac9b Signed-off-by: Vasyl Razinkov Issue-ID: SDC-3757 --- .../sdc/be/tosca/utils/ForwardingPathToscaUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'catalog-be/src/main/java/org') 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 componentInstanceByName = service.getComponentInstanceByName(nodeId); + if (componentInstanceByName.isPresent()) { + return componentInstanceByName.get().getName(); } else { return ""; } -- cgit 1.2.3-korg