summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java68
1 files changed, 8 insertions, 60 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java
index b0124e4e44..98fceab7a8 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java
@@ -1,26 +1,24 @@
package org.openecomp.sdc.be.components.merge.input;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
import org.junit.Before;
import org.junit.Test;
import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
import org.openecomp.sdc.be.components.utils.ResourceBuilder;
import org.openecomp.sdc.be.dao.utils.MapUtil;
-import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.ComponentInstanceInput;
import org.openecomp.sdc.be.model.ComponentInstanceProperty;
import org.openecomp.sdc.be.model.InputDefinition;
import org.openecomp.sdc.be.model.Resource;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
public class InputsValuesMergingBusinessLogicTest {
public static final String INPUT_DEFUALT_TYPE = "string";
@@ -133,54 +131,4 @@ public class InputsValuesMergingBusinessLogicTest {
inputDef.setOwnerId("owner");
return inputDef;
}
-
- private void addInstanceProperty(Resource resource, ComponentInstanceProperty prop, String instanceId) {
- addInstancePropDefinition(resource.getComponentInstancesProperties(), prop, instanceId);
- }
-
- private void addInstanceInput(Resource resource, ComponentInstanceInput prop, String instanceId) {
- addInstancePropDefinition(resource.getComponentInstancesInputs(), prop, instanceId);
- }
-
- private <T extends PropertyDataDefinition> void addInstancePropDefinition(Map<String, List<T>> propsDefinitions, T propDef, String instanceId) {
- propsDefinitions.computeIfAbsent(instanceId, id -> new ArrayList<>()).add(propDef);
- }
-
- private Resource createResourceWithInputs(String ... inputsIds) {
- Resource resource = new Resource();
- List<InputDefinition> inputs = new ArrayList<>();
- for (String inputId : inputsIds) {
- InputDefinition inputDefinition = new InputDefinition();
- inputDefinition.setOwnerId("cs0008");
- inputDefinition.setUniqueId(inputId);
- inputs.add(inputDefinition);
- }
- resource.setInputs(inputs);
- return resource;
- }
-
-
- private ComponentInstanceProperty createGetInputComponentProperty(String ... declaredToInputId) {
- ComponentInstanceProperty prevDeclaredProperty = new ComponentInstanceProperty();
- for (String inputId : declaredToInputId) {
- addGetInputValueOnProp(inputId, prevDeclaredProperty);
- }
-
- return prevDeclaredProperty;
- }
-
- private void addGetInputValueOnProp(String declaredToInputId, PropertyDataDefinition declaredProperty) {
- GetInputValueDataDefinition getInputDef = new GetInputValueDataDefinition();
- getInputDef.setInputId(declaredToInputId);
- if (declaredProperty.getGetInputValues() == null) {
- declaredProperty.setGetInputValues(new ArrayList<>());
- }
- declaredProperty.getGetInputValues().add(getInputDef);
- }
-
- private ComponentInstanceInput createGetInputComponentInstanceInput(String declaredToInputId) {
- ComponentInstanceInput prevDeclaredProp = new ComponentInstanceInput();
- addGetInputValueOnProp(declaredToInputId, prevDeclaredProp);
- return prevDeclaredProp;
- }
} \ No newline at end of file