diff options
author | franciscovila <javier.paradela.vila@est.tech> | 2023-05-30 17:03:07 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-06-02 14:29:33 +0000 |
commit | b206d04b36eb66fc69c1ac96c700d19ca0fbbd37 (patch) | |
tree | 54bea30b1f70670b5763f1499eed8af55a45cd6d /common-be/src/test/java/org | |
parent | 38812c3d47f0426f1c4108145b696441da5a5c1f (diff) |
Support INDEX in node filter tosca functions
Issue-ID: SDC-4517
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: I36e33821ef72c3375d9525513f2394b9b772c696
Diffstat (limited to 'common-be/src/test/java/org')
-rw-r--r-- | common-be/src/test/java/org/openecomp/sdc/be/utils/PropertyFilterConstraintDataDefinitionHelperTest.java | 11 |
1 files changed, 11 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")); |