2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.components.impl;
23 import com.google.common.collect.Lists;
24 import fj.data.Either;
25 import org.junit.Test;
26 import org.mockito.Mockito;
27 import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum;
28 import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaElementTypeEnum;
29 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
30 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
31 import org.openecomp.sdc.be.model.AttributeDefinition;
32 import org.openecomp.sdc.be.model.HeatParameterDefinition;
33 import org.openecomp.sdc.be.model.InputDefinition;
34 import org.openecomp.sdc.be.model.PropertyConstraint;
35 import org.openecomp.sdc.be.model.PropertyDefinition;
36 import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition;
37 import org.openecomp.sdc.be.model.operations.impl.AnnotationTypeOperations;
38 import org.openecomp.sdc.be.model.tosca.constraints.ValidValuesConstraint;
39 import org.openecomp.sdc.be.utils.TypeUtils;
40 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
41 import org.yaml.snakeyaml.Yaml;
43 import java.io.IOException;
44 import java.nio.file.FileSystems;
45 import java.nio.file.Files;
46 import java.util.ArrayList;
47 import java.util.HashMap;
48 import java.util.Iterator;
49 import java.util.List;
51 import java.util.Map.Entry;
53 import static org.junit.Assert.assertEquals;
54 import static org.junit.Assert.assertFalse;
55 import static org.junit.Assert.assertNotNull;
56 import static org.junit.Assert.assertTrue;
58 public class ImportUtilsTest {
62 public void testStringTypeFindToscaElements() throws IOException {
63 Either<List<Object>, ResultStatusEnum> toscaElements = ImportUtils.findToscaElements((Map<String, Object>) loadJsonFromFile("normative-types-string-list-test.yml"), "stringTestTag", ToscaElementTypeEnum.STRING, new ArrayList<>());
64 assertTrue(toscaElements.isLeft());
65 List<Object> list = toscaElements.left().value();
66 assertEquals(4, list.size());
68 for (Object element : list) {
69 assertTrue(element instanceof String);
70 String value = (String) element;
71 assertEquals(value, "stringVal" + count);
77 public void testBooleanTypeFindToscaElements() throws IOException {
78 Either<List<Object>, ResultStatusEnum> toscaElements = ImportUtils.findToscaElements((Map<String, Object>) loadJsonFromFile("normative-types-all-map-test.yml"), "required", ToscaElementTypeEnum.BOOLEAN, new ArrayList<>());
79 assertTrue(toscaElements.isLeft());
80 List<Object> list = toscaElements.left().value();
81 assertEquals(3, list.size());
83 for (Object element : list) {
84 assertTrue(element instanceof Boolean);
85 Boolean value = (Boolean) element;
86 if (count == 1 || count == 3) {
88 } else if (count == 2) {
97 public void testListTypeFindToscaElements() throws IOException {
98 Either<List<Object>, ResultStatusEnum> toscaElements = ImportUtils.findToscaElements((Map<String, Object>) loadJsonFromFile("normative-types-string-list-test.yml"), "listTestTag", ToscaElementTypeEnum.LIST, new ArrayList<>());
99 assertTrue(toscaElements.isLeft());
100 List<Object> list = toscaElements.left().value();
101 assertEquals(3, list.size());
103 for (Object element : list) {
104 assertTrue(element instanceof List);
107 verifyListElement1(element);
108 } else if (count == 2) {
109 verifyListElement2(element);
112 else if (count == 3) {
113 verifyListElement3(element);
120 public void testAllTypeFindToscaElements() throws IOException {
121 Either<List<Object>, ResultStatusEnum> toscaElements = ImportUtils.findToscaElements((Map<String, Object>) loadJsonFromFile("normative-types-all-map-test.yml"), "allTestTag", ToscaElementTypeEnum.ALL, new ArrayList<>());
122 assertTrue(toscaElements.isLeft());
123 List<Object> list = toscaElements.left().value();
124 assertEquals(5, list.size());
126 for (Object element : list) {
128 assertTrue(element instanceof String);
129 assertEquals("tosca.nodes.Root", element);
130 } else if (count == 2) {
131 assertTrue(element instanceof Map);
132 Map<String, Object> mapElement = (Map<String, Object>) element;
133 assertEquals(2, mapElement.size());
134 Iterator<Entry<String, Object>> elementEntries = mapElement.entrySet().iterator();
135 Entry<String, Object> elementEntry = elementEntries.next();
136 assertEquals("mapTestTag", elementEntry.getKey());
137 assertEquals("string", elementEntry.getValue());
139 elementEntry = elementEntries.next();
140 assertEquals("required", elementEntry.getKey());
141 assertTrue(elementEntry.getValue() instanceof Boolean);
142 assertTrue((Boolean) elementEntry.getValue());
145 else if (count == 3) {
146 assertTrue(element instanceof String);
147 assertEquals("1 MB", element);
150 else if (count == 4) {
151 assertTrue(element instanceof List);
152 List<Object> listElement = (List<Object>) element;
153 assertEquals(2, listElement.size());
155 assertTrue(listElement.get(0) instanceof Map);
156 Map<String, Object> innerElement = (Map<String, Object>) listElement.get(0);
157 assertEquals(1, innerElement.size());
158 Entry<String, Object> innerEntry = innerElement.entrySet().iterator().next();
159 assertEquals("greater_or_equal", innerEntry.getKey());
160 assertEquals("1 MB", innerEntry.getValue());
162 assertTrue(listElement.get(1) instanceof Map);
163 innerElement = (Map<String, Object>) listElement.get(1);
164 assertEquals(1, innerElement.size());
165 innerEntry = innerElement.entrySet().iterator().next();
166 assertEquals("stringTestTag", innerEntry.getKey());
167 assertEquals("stringVal3", innerEntry.getValue());
168 } else if (count == 5) {
169 assertTrue(element instanceof Boolean);
170 assertFalse((Boolean) element);
177 public void testMapTypeFindToscaElements() throws IOException {
178 Either<List<Object>, ResultStatusEnum> toscaElements = ImportUtils.findToscaElements((Map<String, Object>) loadJsonFromFile("normative-types-all-map-test.yml"), "mapTestTag", ToscaElementTypeEnum.MAP, new ArrayList<>());
179 assertTrue(toscaElements.isLeft());
180 List<Object> list = toscaElements.left().value();
181 assertEquals(2, list.size());
183 for (Object element : list) {
184 assertTrue(element instanceof Map);
187 Map<String, Object> mapElement = (Map<String, Object>) element;
188 assertEquals(2, mapElement.size());
189 Iterator<Entry<String, Object>> iterator = mapElement.entrySet().iterator();
190 Entry<String, Object> inerElementEntry = iterator.next();
191 assertEquals("stringTestTag", inerElementEntry.getKey());
192 assertEquals("stringVal1", inerElementEntry.getValue());
194 inerElementEntry = iterator.next();
195 assertEquals("listTestTag", inerElementEntry.getKey());
196 assertTrue(inerElementEntry.getValue() instanceof List);
197 List<Object> innerValue = (List<Object>) inerElementEntry.getValue();
199 assertEquals(3, innerValue.size());
201 } else if (count == 2) {
202 Map<String, Object> mapElement = (Map<String, Object>) element;
203 assertEquals(2, mapElement.size());
204 Iterator<Entry<String, Object>> entryItr = mapElement.entrySet().iterator();
205 Entry<String, Object> inerElementEntry = entryItr.next();
206 assertEquals("type", inerElementEntry.getKey());
207 assertEquals("tosca.capabilities.Attachment", inerElementEntry.getValue());
208 inerElementEntry = entryItr.next();
209 assertEquals("allTestTag", inerElementEntry.getKey());
210 assertTrue(inerElementEntry.getValue() instanceof Boolean);
218 public void testCreateFullHeatParameterModuleWithString() {
220 testCreateFullHeatParameterModule("string", "default value");
225 public void testCreateFullHeatParameterModuleWithNumber() {
227 testCreateFullHeatParameterModule("number", "777");
228 testCreateFullHeatParameterModule("number", "777.23");
233 public void testCreateFullHeatParameterModuleWithBoolean() {
235 testCreateFullHeatParameterModule("boolean", "true");
236 testCreateFullHeatParameterModule("boolean", "on");
237 testCreateFullHeatParameterModule("boolean", "n");
242 public void testCreateFullHeatParameterModuleWithList() {
244 testCreateFullHeatParameterModule("comma_delimited_list", "[one, two]");
249 // public void testCreateFullHeatParameterModuleWithInvalidType(){
251 // String name = "fullParameter";
252 // String description = "description_text";
254 // Map<String, Object> parametersMap = new HashMap<String, Object>();
255 // Map<String, Object> firstParam = createParameterMap("aaa", "aaa",
256 // name, description);
257 // parametersMap.put(ToscaTagNamesEnum.PARAMETERS.getElementName(),
260 // Either<List<HeatParameterDefinition>,ResultStatusEnum> heatParameters =
261 // ImportUtils.getHeatParameters(parametersMap);
262 // assertTrue(heatParameters.isRight());
263 // assertEquals(ResultStatusEnum.INVALID_PROPERTY_TYPE,
264 // heatParameters.right().value());
269 public void testCreateFullHeatParameterModuleWithMissingType() {
271 String name = "fullParameter";
272 String description = "description_text";
274 Map<String, Object> parametersMap = new HashMap<>();
275 Map<String, Object> firstParam = createParameterMap(null, "aaa", name, description);
276 parametersMap.put(TypeUtils.ToscaTagNamesEnum.PARAMETERS.getElementName(), firstParam);
278 Either<List<HeatParameterDefinition>, ResultStatusEnum> heatParameters = ImportUtils.getHeatParameters(parametersMap, ArtifactTypeEnum.HEAT.getType());
279 assertTrue(heatParameters.isRight());
280 assertEquals(ResultStatusEnum.INVALID_PROPERTY_TYPE, heatParameters.right().value());
285 public void testCreateFullHeatParameterModuleWithMissingFields() {
287 String name = "fullParameter";
289 Map<String, Object> parametersMap = new HashMap<>();
290 String type = "number";
291 String defValue = "defvalue";
292 // default value cannot be empty in heat in case tag exists
293 Map<String, Object> firstParam = createParameterMap(type, defValue, name, null);
294 parametersMap.put(TypeUtils.ToscaTagNamesEnum.PARAMETERS.getElementName(), firstParam);
296 Either<List<HeatParameterDefinition>, ResultStatusEnum> heatParameters = ImportUtils.getHeatParameters(parametersMap, ArtifactTypeEnum.HEAT.getType());
297 assertTrue(heatParameters.isLeft());
298 List<HeatParameterDefinition> parameterDefList = heatParameters.left().value();
299 assertFalse(parameterDefList.isEmpty());
300 HeatParameterDefinition parameterDefinition = parameterDefList.get(0);
302 assertParameter(parameterDefinition, name, type, null, defValue);
307 public void testGetAttributesFromYml() throws IOException {
309 Map<String, Object> toscaJson = (Map<String, Object>) loadJsonFromFile("importToscaWithAttribute.yml");
310 Either<Map<String, AttributeDataDefinition>, ResultStatusEnum> actualAttributes = ImportUtils.getAttributes(toscaJson);
311 assertTrue(actualAttributes.isLeft());
312 Map<String, Map<String, Object>> expectedAttributes = getElements(toscaJson, TypeUtils.ToscaTagNamesEnum.ATTRIBUTES);
313 compareAttributes(expectedAttributes, actualAttributes.left().value());
318 public void testGetPropertiesFromYml() throws IOException {
320 Map<String, Object> toscaJson = (Map<String, Object>) loadJsonFromFile("importToscaProperties.yml");
321 Either<Map<String, PropertyDefinition>, ResultStatusEnum> actualProperties = ImportUtils.getProperties(toscaJson);
322 assertTrue(actualProperties.isLeft());
323 Map<String, Map<String, Object>> expectedProperties = getElements(toscaJson, TypeUtils.ToscaTagNamesEnum.PROPERTIES);
324 compareProperties(expectedProperties, actualProperties.left().value());
329 public void testGetPropertiesWithConstraintsFromYml() throws IOException {
331 Map<String, Object> toscaJson = (Map<String, Object>) loadJsonFromFile("propertyConstraintsTest.yml");
332 Either<Map<String, PropertyDefinition>, ResultStatusEnum> actualProperties = ImportUtils.getProperties(toscaJson);
333 assertTrue(actualProperties.isLeft());
334 Map<String, PropertyDefinition> properties = actualProperties.left().value();
335 assertTrue(properties.containsKey("service_type"));
336 PropertyDefinition property = properties.get("service_type");
337 assertTrue(property.getConstraints()!= null && property.getConstraints().size() == 1);
338 assertTrue(property.getConstraints().get(0) instanceof ValidValuesConstraint);
339 assertTrue(((ValidValuesConstraint) property.getConstraints().get(0)).getValidValues() != null);
340 List<String> validValues = ((ValidValuesConstraint) property.getConstraints().get(0)).getValidValues();
341 assertTrue(validValues.containsAll(Lists.newArrayList("firewall", "analyzer", "source-nat", "loadbalancer")));
343 assertTrue(properties.containsKey("service_interface_type_list"));
344 property = properties.get("service_interface_type_list");
345 assertTrue(property.getSchema()!= null && property.getSchema().getProperty() != null);
346 PropertyDefinition innerProperty = new PropertyDefinition(property.getSchema().getProperty());
347 List<PropertyConstraint> innerConstraints = innerProperty.getConstraints();
348 assertTrue(innerConstraints.get(0) instanceof ValidValuesConstraint);
349 assertTrue(((ValidValuesConstraint) innerConstraints.get(0)).getValidValues() != null);
350 validValues = ((ValidValuesConstraint) innerConstraints.get(0)).getValidValues();
351 assertTrue(validValues.containsAll(Lists.newArrayList("management", "left", "right", "other")));
355 public void testGetInputsFromYml() throws IOException {
357 Map<String, Object> toscaJson = (Map<String, Object>) loadJsonFromFile("importToscaInputs.yml");
359 AnnotationTypeOperations annotationTypeOperations= Mockito.mock(AnnotationTypeOperations.class);
360 Mockito.when(annotationTypeOperations.getLatestType(Mockito.anyString())).thenReturn(null);
362 Either<Map<String, InputDefinition>, ResultStatusEnum> actualInputs = ImportUtils.getInputs(toscaJson,annotationTypeOperations);
363 assertTrue(actualInputs.isLeft());
364 Map<String, Map<String, Object>> expectedProperties = getElements(toscaJson, TypeUtils.ToscaTagNamesEnum.INPUTS);
365 compareProperties(expectedProperties, actualInputs.left().value());
369 private void compareAttributes(Map<String, Map<String, Object>> expected, Map<String, AttributeDataDefinition> actual) {
371 Map<String, Object> singleExpectedAttribute;
372 AttributeDataDefinition actualAttribute, expectedAttributeModel;
373 // attributes of resource
374 for (Map.Entry<String, Map<String, Object>> expectedAttribute : expected.entrySet()) {
376 singleExpectedAttribute = expectedAttribute.getValue();
377 assertNotNull(singleExpectedAttribute);
378 actualAttribute = actual.get(expectedAttribute.getKey());
379 assertNotNull(actualAttribute);
380 actualAttribute.setName(expectedAttribute.getKey().toString());
381 expectedAttributeModel = ImportUtils.createModuleAttribute(singleExpectedAttribute);
382 expectedAttributeModel.setName(expectedAttribute.getKey().toString());
384 assertEquals(((AttributeDefinition)expectedAttributeModel).getDefaultValue(), ((AttributeDefinition)actualAttribute).getDefaultValue());
385 assertEquals(((AttributeDefinition)expectedAttributeModel).getDescription(), ((AttributeDefinition)actualAttribute).getDescription());
386 assertEquals(((AttributeDefinition)expectedAttributeModel).getName(), ((AttributeDefinition)actualAttribute).getName());
387 assertEquals(((AttributeDefinition)expectedAttributeModel).getStatus(), ((AttributeDefinition)actualAttribute).getStatus());
388 assertEquals(((AttributeDefinition)expectedAttributeModel).getType(), ((AttributeDefinition)actualAttribute).getType());
390 compareSchemas(expectedAttributeModel.getSchema(), actualAttribute.getSchema());
396 private void compareProperties(Map<String, Map<String, Object>> expected, Map<String, ? extends PropertyDefinition > actual) {
398 Map<String, Object> singleExpectedProperty;
399 PropertyDefinition actualProperty, expectedPropertyModel;
401 for (Map.Entry<String, Map<String, Object>> expectedProperty : expected.entrySet()) {
403 singleExpectedProperty = expectedProperty.getValue();
404 assertNotNull(singleExpectedProperty);
405 actualProperty = actual.get(expectedProperty.getKey());
406 assertNotNull(actualProperty);
407 actualProperty.setName(expectedProperty.getKey().toString());
408 expectedPropertyModel = ImportUtils.createModuleProperty(singleExpectedProperty);
409 expectedPropertyModel.setName(expectedProperty.getKey().toString());
411 assertEquals(expectedPropertyModel.getDefaultValue(), actualProperty.getDefaultValue());
412 assertEquals(expectedPropertyModel.getDescription(), actualProperty.getDescription());
413 assertEquals(expectedPropertyModel.getName(), actualProperty.getName());
414 assertEquals(expectedPropertyModel.getStatus(), actualProperty.getStatus());
415 assertEquals(expectedPropertyModel.getType(), actualProperty.getType());
417 compareSchemas(expectedPropertyModel.getSchema(), actualProperty.getSchema());
423 private void compareSchemas(SchemaDefinition expected, SchemaDefinition actual) {
425 if (expected == null && actual == null) {
428 PropertyDataDefinition actualPropertySchema = actual.getProperty();
429 PropertyDataDefinition expectedPropertySchema = expected.getProperty();
430 assertNotNull(actualPropertySchema);
431 assertNotNull(expectedPropertySchema);
432 assertEquals(expectedPropertySchema.getDescription(), actualPropertySchema.getDescription());
433 assertEquals(expectedPropertySchema.getType(), actualPropertySchema.getType());
437 private <T> Map<String, T> getElements(Map<String, Object> toscaJson, TypeUtils.ToscaTagNamesEnum elementType) {
439 Either<Map<String, T>, ResultStatusEnum> toscaExpectedElements = ImportUtils.findFirstToscaMapElement(toscaJson, elementType);
440 assertTrue(toscaExpectedElements.isLeft());
442 return toscaExpectedElements.left().value();
446 private void testCreateFullHeatParameterModule(String type, Object defaultVal) {
448 String name = "fullParameter";
449 String description = "description_text";
451 Map<String, Object> parametersMap = new HashMap<>();
452 Map<String, Object> firstParam = createParameterMap(type, defaultVal, name, description);
453 parametersMap.put(TypeUtils.ToscaTagNamesEnum.PARAMETERS.getElementName(), firstParam);
455 Either<List<HeatParameterDefinition>, ResultStatusEnum> heatParameters = ImportUtils.getHeatParameters(parametersMap, ArtifactTypeEnum.HEAT.getType());
456 assertTrue(heatParameters.isLeft());
457 List<HeatParameterDefinition> parameterDefList = heatParameters.left().value();
458 assertFalse(parameterDefList.isEmpty());
459 HeatParameterDefinition parameterDefinition = parameterDefList.get(0);
461 assertParameter(parameterDefinition, name, type, description, defaultVal);
465 private Map<String, Object> createParameterMap(String type, Object defaultVal, String name, String description) {
466 Map<String, Object> firstParam = new HashMap<>();
467 Map<String, Object> valuesMap = new HashMap<>();
469 valuesMap.put(TypeUtils.ToscaTagNamesEnum.TYPE.getElementName(), type);
470 valuesMap.put(TypeUtils.ToscaTagNamesEnum.DESCRIPTION.getElementName(), description);
471 valuesMap.put(TypeUtils.ToscaTagNamesEnum.DEFAULT_VALUE.getElementName(), defaultVal);
473 firstParam.put(name, valuesMap);
477 private void assertParameter(HeatParameterDefinition parameterDefinition, String name, String type, String description, Object defaultVal) {
478 assertEquals(name, parameterDefinition.getName());
479 assertEquals(description, parameterDefinition.getDescription());
480 assertEquals(type, parameterDefinition.getType());
481 assertEquals(String.valueOf(defaultVal), parameterDefinition.getDefaultValue());
482 assertEquals(String.valueOf(defaultVal), parameterDefinition.getCurrentValue());
485 private void verifyListElement3(Object element) {
486 List<Object> listElement = (List<Object>) element;
487 assertEquals(2, listElement.size());
489 Map<String, String> innerElement = (Map<String, String>) listElement.get(0);
490 assertEquals(1, innerElement.size());
491 Entry<String, String> innerEntry = innerElement.entrySet().iterator().next();
492 assertEquals("testTag1", innerEntry.getKey());
493 assertEquals("1 MB", innerEntry.getValue());
495 innerElement = (Map<String, String>) listElement.get(1);
496 assertEquals(1, innerElement.size());
497 innerEntry = innerElement.entrySet().iterator().next();
498 assertEquals("type", innerEntry.getKey());
499 assertEquals("stringVal2", innerEntry.getValue());
502 private void verifyListElement2(Object element) {
503 List<Object> listElement = (List<Object>) element;
504 assertEquals(2, listElement.size());
506 Map<String, Object> innerElement = (Map<String, Object>) listElement.get(0);
507 assertEquals(1, innerElement.size());
508 Entry<String, Object> innerEntry = innerElement.entrySet().iterator().next();
509 assertEquals("testTag1", innerEntry.getKey());
510 assertEquals("1 MB", innerEntry.getValue());
512 assertTrue(listElement.get(1) instanceof Map);
513 innerElement = (Map<String, Object>) listElement.get(1);
514 assertEquals(1, innerElement.size());
515 innerEntry = innerElement.entrySet().iterator().next();
516 assertEquals("listTestTag", innerEntry.getKey());
517 assertTrue(innerEntry.getValue() instanceof List);
520 private void verifyListElement1(Object element) {
521 List<Object> listElement = (List<Object>) element;
522 assertEquals(3, listElement.size());
524 Map<String, String> innerElement = (Map<String, String>) listElement.get(0);
525 assertEquals(1, innerElement.size());
526 Entry<String, String> innerEntry = innerElement.entrySet().iterator().next();
527 assertEquals("listTestTag", innerEntry.getKey());
528 assertEquals("1 MB", innerEntry.getValue());
530 innerElement = (Map<String, String>) listElement.get(1);
531 assertEquals(1, innerElement.size());
532 innerEntry = innerElement.entrySet().iterator().next();
533 assertEquals("listTestTag", innerEntry.getKey());
534 assertEquals("2 MB", innerEntry.getValue());
536 innerElement = (Map<String, String>) listElement.get(2);
537 assertEquals(1, innerElement.size());
538 innerEntry = innerElement.entrySet().iterator().next();
539 assertEquals("stringTestTag", innerEntry.getKey());
540 assertEquals("stringVal2", innerEntry.getValue());
543 public static String loadFileNameToJsonString(String fileName) throws IOException {
544 String sourceDir = "src/test/resources/normativeTypes";
545 return loadFileNameToJsonString(sourceDir, fileName);
548 public static String loadCustomTypeFileNameToJsonString(String fileName) throws IOException {
549 String sourceDir = "src/test/resources/customTypes";
550 return loadFileNameToJsonString(sourceDir, fileName);
553 private static String loadFileNameToJsonString(String sourceDir, String fileName) throws IOException {
554 java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir, fileName);
555 byte[] fileContent = Files.readAllBytes(filePath);
556 return new String(fileContent);
560 private static Object loadJsonFromFile(String fileName) throws IOException {
561 String content = loadFileNameToJsonString(fileName);
562 return new Yaml().load(content);