aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2022-07-04 15:47:48 +0100
committerAndr� Schmid <andre.schmid@est.tech>2022-07-11 15:37:30 +0000
commita99abdf5317f4f0f7435af71278701b3b43282a2 (patch)
treeb7add2f18b556cc73b4620af954928a6016bbed8 /catalog-be
parent6545802c422ae1c40f994d2e8083666217d55848 (diff)
Fix 'Fail to declare Input for duplicated name of property'
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Ib9ef09944b0ae31b1cfd0dc42d9e7026b5a6ba8f Issue-ID: SDC-4081
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java11
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java4
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java2
4 files changed, 9 insertions, 10 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
index 33bb8650ae..18993e8f65 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java
@@ -91,7 +91,6 @@ public class InputsBusinessLogic extends BaseBusinessLogic {
private static final String UPDATE_INPUT = "UpdateInput";
private static final Logger log = Logger.getLogger(InputsBusinessLogic.class);
private static final String FAILED_TO_FOUND_COMPONENT_ERROR = "Failed to found component {}, error: {}";
- private static final String GET_PROPERTIES_BY_INPUT = "get Properties by input";
private static final String FAILED_TO_FOUND_INPUT_UNDER_COMPONENT_ERROR = "Failed to found input {} under component {}, error: {}";
private static final String GOING_TO_EXECUTE_ROLLBACK_ON_CREATE_GROUP = "Going to execute rollback on create group.";
private static final String GOING_TO_EXECUTE_COMMIT_ON_CREATE_GROUP = "Going to execute commit on create group.";
@@ -264,8 +263,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic {
}
public Either<List<InputDefinition>, ResponseFormat> updateInputsValue(ComponentTypeEnum componentType, String componentId,
- List<InputDefinition> inputs, String userId, boolean shouldLockComp,
- boolean inTransaction) {
+ List<InputDefinition> inputs, String userId, boolean shouldLockComp) {
List<InputDefinition> returnInputs = new ArrayList<>();
Either<List<InputDefinition>, ResponseFormat> result = null;
org.openecomp.sdc.be.model.Component component = null;
@@ -385,9 +383,10 @@ public class InputsBusinessLogic extends BaseBusinessLogic {
return createMultipleInputs(userId, componentId, componentTypeEnum, componentInstInputsMap, true, false);
}
- public Either<List<InputDefinition>, ResponseFormat> createMultipleInputs(String userId, String componentId, ComponentTypeEnum componentType,
- ComponentInstInputsMap componentInstInputsMapUi, boolean shouldLockComp,
- boolean inTransaction) {
+ private Either<List<InputDefinition>, ResponseFormat> createMultipleInputs(String userId, String componentId, ComponentTypeEnum componentType,
+ ComponentInstInputsMap componentInstInputsMapUi,
+ boolean shouldLockComp,
+ boolean inTransaction) {
Either<List<InputDefinition>, ResponseFormat> result = null;
org.openecomp.sdc.be.model.Component component = null;
try {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
index 07fb64f3b4..0412516390 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
@@ -72,7 +72,7 @@ public abstract class DefaultPropertyDeclarator<PROPERTYOWNER extends Properties
private ComponentsUtils componentsUtils;
private PropertyOperation propertyOperation;
- public DefaultPropertyDeclarator(ComponentsUtils componentsUtils, PropertyOperation propertyOperation) {
+ protected DefaultPropertyDeclarator(ComponentsUtils componentsUtils, PropertyOperation propertyOperation) {
this.componentsUtils = componentsUtils;
this.propertyOperation = propertyOperation;
}
@@ -241,7 +241,7 @@ public abstract class DefaultPropertyDeclarator<PROPERTYOWNER extends Properties
private InputDefinition createInput(Component component, PROPERTYOWNER propertiesOwner, ComponentInstancePropInput propInput,
PropertyDataDefinition prop) {
String generatedInputPrefix = propertiesOwner.getNormalizedName();
- if (propertiesOwner.getUniqueId().equals(propInput.getParentUniqueId())) {
+ if (component.getUniqueId().equals(propInput.getParentUniqueId())) {
//Creating input from property create on self using add property..Do not add the prefix
generatedInputPrefix = null;
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
index 144c19ee26..154060509e 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
@@ -140,7 +140,7 @@ public class InputsServlet extends AbstractValidationsServlet {
return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.UNSUPPORTED_ERROR));
}
Either<List<InputDefinition>, ResponseFormat> actionResponse = inputsBusinessLogic
- .updateInputsValue(componentType, componentId, inputsToUpdate, userId, true, false);
+ .updateInputsValue(componentType, componentId, inputsToUpdate, userId, true);
if (actionResponse.isRight()) {
return buildErrorResponse(actionResponse.right().value());
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
index fd057607a1..f09f90b4ed 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
@@ -797,7 +797,7 @@ public class InputsBusinessLogicTest {
.thenReturn(Either.left(inputDef));
Either<List<InputDefinition>, ResponseFormat> result =
- testInstance.updateInputsValue(service.getComponentType(), COMPONENT_ID, newInputDefs, USER_ID, true, false);
+ testInstance.updateInputsValue(service.getComponentType(), COMPONENT_ID, newInputDefs, USER_ID, true);
assertThat(result.isLeft()).isTrue();
// check if values are updated
assertEquals(NEW_VALUE, service.getInputs().get(0).getDefaultValue());