From d3bf58392f2a1c98b8d2289b70844ce39fb62e64 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Sun, 8 Oct 2023 15:09:11 +0100 Subject: Fix error updating milestone Signed-off-by: MichaelMorris Issue-ID: SDC-4648 Change-Id: Iff21ecf1e0b999301baf6b7a2c26218fee8856da --- .../components/impl/ComponentInterfaceOperationBusinessLogic.java | 2 +- .../impl/ComponentInterfaceOperationBusinessLogicTest.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'catalog-be/src') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogic.java index a10bae9c1e..32fdffe1b4 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogic.java @@ -140,7 +140,7 @@ public class ComponentInterfaceOperationBusinessLogic extends BaseBusinessLogic final OperationDataDefinition updatedOperationDataDefinition = optionalOperationDataDefinition.get(); final Optional optionalComponentInstanceInterface = componentInstanceInterfaceList.stream().filter( ci -> ci.getOperations().values().stream().anyMatch( - operationDataDefinition -> operationDataDefinition.getUniqueId().equalsIgnoreCase(updatedOperationDataDefinition.getUniqueId()))) + operationDataDefinition -> operationDataDefinition.getName().equalsIgnoreCase(updatedOperationDataDefinition.getName()))) .findFirst(); if (optionalComponentInstanceInterface.isEmpty()) { responseFormat = componentsUtils.getResponseFormat(ActionStatus.INTERFACE_NOT_FOUND_IN_COMPONENT); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogicTest.java index 1dd7f40730..42cf3f21d0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInterfaceOperationBusinessLogicTest.java @@ -133,6 +133,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); artifactDataDefinition.setArtifactName("EO Implementation info"); operationDataDefinition.setImplementation(artifactDataDefinition); @@ -180,6 +181,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); final ListDataDefinition inputsDefinitionListData = new ListDataDefinition<>(); OperationInputDefinition input1 = new OperationInputDefinition(); @@ -238,6 +240,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); final ListDataDefinition inputsDefinitionListData = new ListDataDefinition<>(); OperationInputDefinition input1 = new OperationInputDefinition(); @@ -299,6 +302,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); artifactDataDefinition.setArtifactName("EO Implementation info"); @@ -364,6 +368,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); artifactDataDefinition.setArtifactName("EO Implementation info"); @@ -429,6 +434,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); artifactDataDefinition.setArtifactName("EO Implementation info"); operationDataDefinition.setImplementation(artifactDataDefinition); @@ -468,6 +474,7 @@ class ComponentInterfaceOperationBusinessLogicTest extends BaseBusinessLogicMock final Map operations = new HashMap<>(); final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); + operationDataDefinition.setName("myOperationName"); final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); artifactDataDefinition.setArtifactName("EO Implementation info"); operationDataDefinition.setImplementation(artifactDataDefinition); -- cgit 1.2.3-korg