aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2022-05-26 09:41:11 +0100
committerAndr� Schmid <andre.schmid@est.tech>2022-05-27 11:35:18 +0000
commit577c692dc7a78d19c5bcecdf0387bbabc1dadcd6 (patch)
tree1b83c5dc042c4066f1816bf8a801cbec1426b69c /catalog-be/src/test
parentf9c261d6349d53b30ba12c7a3db755ba8c31d2f6 (diff)
Fix error handling valid yaml property values
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-4022 Change-Id: Ic30f29e350d47d29c00744271e1e81b08db3edb9
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
index 36c9eb8288..cd756ce49d 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
@@ -183,5 +183,18 @@ class PropertyConvertorTest {
propertyConvertor.convertProperty(Collections.emptyMap(), property, PropertyConvertor.PropertyType.PROPERTY);
assertEquals("/", toscaProperty.getDefaultp());
}
+
+ @Test
+ void convertPropertyWithYamlValue() {
+ final PropertyDefinition property = new PropertyDataDefinitionBuilder()
+ .setDefaultValue("{concat: [ get_input: service_name, '--', 'WirelessService']}")
+ .setType(ToscaPropertyType.STRING.getType())
+ .build();
+ final ToscaProperty toscaProperty =
+ propertyConvertor.convertProperty(Collections.emptyMap(), property, PropertyConvertor.PropertyType.PROPERTY);
+ assertTrue(toscaProperty.getDefaultp() instanceof Map);
+ assertTrue(((Map)toscaProperty.getDefaultp()).get("concat") instanceof List);
+ assertEquals(3, ((List)((Map)toscaProperty.getDefaultp()).get("concat")).size());
+ }
}