summaryrefslogtreecommitdiffstats
path: root/common-be/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'common-be/src/test')
-rw-r--r--common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java11
-rw-r--r--common-be/src/test/resources/nodeFilter/constraints/legacy-get_input-from-self.yaml6
2 files changed, 17 insertions, 0 deletions
diff --git a/common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java b/common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java
index 86548fa1d5..5684db2332 100644
--- a/common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java
+++ b/common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java
@@ -77,6 +77,17 @@ class PropertyFilterConstraintDataDefinitionHelperTest {
}
@Test
+ void convertLegacyConstraintGetInputFromSelfTest() throws IOException {
+ final PropertyFilterConstraintDataDefinition propertyFilterConstraint =
+ PropertyFilterConstraintDataDefinitionHelper.convertLegacyConstraint(readConstraintFile("legacy-get_input-from-self.yaml"));
+ assertPropertyFilterConstraint(propertyFilterConstraint, "flavour_id", null, ConstraintType.EQUAL, FilterValueType.GET_INPUT);
+ assertTrue(propertyFilterConstraint.getValue() instanceof ToscaGetFunctionDataDefinition);
+ final var toscaGetFunction = (ToscaGetFunctionDataDefinition) propertyFilterConstraint.getValue();
+ assertToscaGetFunction(toscaGetFunction, ToscaFunctionType.GET_INPUT, ToscaGetFunctionType.GET_INPUT, PropertySource.SELF,
+ List.of("SELF", "input", "subInput"), "subInput", null);
+ }
+
+ @Test
void convertLegacyConstraintGetAttributeFromInstanceTest() throws IOException {
final PropertyFilterConstraintDataDefinition propertyFilterConstraint =
PropertyFilterConstraintDataDefinitionHelper.convertLegacyConstraint(readConstraintFile("legacy-get_attribute-from-instance.yaml"));
diff --git a/common-be/src/test/resources/nodeFilter/constraints/legacy-get_input-from-self.yaml b/common-be/src/test/resources/nodeFilter/constraints/legacy-get_input-from-self.yaml
new file mode 100644
index 0000000000..a12444e8c1
--- /dev/null
+++ b/common-be/src/test/resources/nodeFilter/constraints/legacy-get_input-from-self.yaml
@@ -0,0 +1,6 @@
+flavour_id:
+ equal:
+ get_input:
+ - SELF
+ - input
+ - subInput \ No newline at end of file