diff options
Diffstat (limited to 'common-be/src')
5 files changed, 35 insertions, 43 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java index 422b7eac6c..ef2932a50b 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java @@ -24,10 +24,6 @@ import java.util.Map; public class InputDataDefinition extends PropertyDataDefinition { - private String label; - private Boolean hidden; - private Boolean immutable; - InputDataDefinition() { super(); } @@ -43,31 +39,7 @@ public class InputDataDefinition extends PropertyDataDefinition { this.setImmutable(p.isImmutable()); } - InputDataDefinition(PropertyDataDefinition p) { + public InputDataDefinition(PropertyDataDefinition p) { super(p); } - - public Boolean isHidden() { - return hidden; - } - - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - public Boolean isImmutable() { - return immutable; - } - - public void setImmutable(Boolean immutable) { - this.immutable = immutable; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java index a264d4618f..760802ec39 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java @@ -36,7 +36,6 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri this(); setType(type); setDescription(description); - } @JsonCreator @@ -45,12 +44,13 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri setOperations(new HashMap<>()); } - public InterfaceDataDefinition(InterfaceDataDefinition p) { - setUniqueId(p.getUniqueId()); - setType(p.getType()); - setDescription(p.getDescription()); - setToscaResourceName(p.getToscaResourceName()); - setOperations(p.getOperations()); + public InterfaceDataDefinition(final InterfaceDataDefinition interfaceDataDefinition) { + setUniqueId(interfaceDataDefinition.getUniqueId()); + setType(interfaceDataDefinition.getType()); + setDescription(interfaceDataDefinition.getDescription()); + setToscaResourceName(interfaceDataDefinition.getToscaResourceName()); + setOperations(interfaceDataDefinition.getOperations()); + setInputs(interfaceDataDefinition.getInputs()); } public String getUniqueId() { @@ -61,10 +61,6 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId); } - public String getType() { - return (String) getToscaPresentationValue(JsonPresentationFields.TYPE); - } - public void setType(String type) { setToscaPresentationValue(JsonPresentationFields.TYPE, type); } @@ -120,4 +116,12 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri public void setLastUpdateDate(Long lastUpdateDate) { setToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate); } + + public Map<String, InputDataDefinition> getInputs() { + return (Map<String, InputDataDefinition>) getToscaPresentationValue(JsonPresentationFields.INTERFACE_INPUT); + } + + public void setInputs(final Map<String, InputDataDefinition> inputs) { + setToscaPresentationValue(JsonPresentationFields.INTERFACE_INPUT, inputs); + } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index 76697a7223..436f958893 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -249,6 +249,7 @@ public enum JsonPresentationFields { //Interface INTERFACES("interfaces", null), + INTERFACE_INPUT("input", null), OPERATIONS("operations", null), OPERATION_IMPLEMENTATION("implementation", null), OPERATION_INPUTS("inputs", null), diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java index a1b14b70ca..ee8c7db4f2 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java @@ -48,6 +48,7 @@ public class TypeUtils { PROPERTIES("properties"), TYPE("type"), STATUS("status"), ENTRY_SCHEMA("entry_schema"), REQUIRED("required"), DESCRIPTION("description"), DEFAULT_VALUE("default"), VALUE("value"), CONSTRAINTS("constraints"), + DEFAULT("default"), // Group Types MEMBERS("members"), METADATA("metadata"), // Policy Types @@ -71,6 +72,8 @@ public class TypeUtils { GET_INPUT("get_input"), // Definitions DATA_TYPES("data_types"), NODE_TYPES("node_types"), IMPORTS("imports"), + //Operations + IMPLEMENTATION("implementation"), DERIVED_FROM_NAME("derivedFromName"); diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java index 1393a095b5..1c0d84df2a 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinitionTest.java @@ -20,12 +20,14 @@ package org.openecomp.sdc.be.datatypes.elements; -import org.junit.Test; - +import java.util.HashMap; import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -public class InterfaceDataDefinitionTest { +class InterfaceDataDefinitionTest { private InterfaceDataDefinition createTestSubject() { return new InterfaceDataDefinition(); @@ -174,4 +176,14 @@ public class InterfaceDataDefinitionTest { testSubject = createTestSubject(); testSubject.setOperations(operations); } + + @Test + void testInputs() { + final InterfaceDataDefinition interfaceDataDefinition = new InterfaceDataDefinition(); + final HashMap<String, InputDataDefinition> anInputMap = new HashMap<>(); + anInputMap.put("anyEntry", new InputDataDefinition()); + interfaceDataDefinition.setInputs(anInputMap); + Assertions.assertEquals(interfaceDataDefinition.getInputs(), + interfaceDataDefinition.getToscaPresentationValue(JsonPresentationFields.INTERFACE_INPUT)); + } } |