From 8a9fc09e276eb5378d3f232f47637125ae5676db Mon Sep 17 00:00:00 2001 From: GIlca Date: Thu, 16 Mar 2023 11:54:17 +0200 Subject: [PATCH] upgrade snakeyaml (cherry picked from commit cef18af3fe265afe2fe50f1cc914493e093dcdb8) --- .../compiler/configuration/SlangCompilerSpringConfig.java | 4 +++- .../systemproperties/SensitiveSystemPropertiesTest.java | 3 +-- pom.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cloudslang-compiler/src/main/java/io/cloudslang/lang/compiler/configuration/SlangCompilerSpringConfig.java b/cloudslang-compiler/src/main/java/io/cloudslang/lang/compiler/configuration/SlangCompilerSpringConfig.java index c51311a143..9223d69510 100644 --- a/cloudslang-compiler/src/main/java/io/cloudslang/lang/compiler/configuration/SlangCompilerSpringConfig.java +++ b/cloudslang-compiler/src/main/java/io/cloudslang/lang/compiler/configuration/SlangCompilerSpringConfig.java @@ -80,8 +80,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.inspector.TrustedTagInspector; import org.yaml.snakeyaml.introspector.BeanAccess; import org.yaml.snakeyaml.introspector.Property; import org.yaml.snakeyaml.introspector.PropertyUtils; @@ -458,7 +460,7 @@ public List transformers() { } private Constructor getConstructor() { - Constructor constructor = new Constructor(ParsedSlang.class); + Constructor constructor = new Constructor(ParsedSlang.class, new LoaderOptions()); constructor.setPropertyUtils(new PropertyUtils() { @Override public Property getProperty(Class type, String name) { diff --git a/cloudslang-tests/src/test/java/io/cloudslang/lang/systemtests/systemproperties/SensitiveSystemPropertiesTest.java b/cloudslang-tests/src/test/java/io/cloudslang/lang/systemtests/systemproperties/SensitiveSystemPropertiesTest.java index 094f36e944..da9533d881 100644 --- a/cloudslang-tests/src/test/java/io/cloudslang/lang/systemtests/systemproperties/SensitiveSystemPropertiesTest.java +++ b/cloudslang-tests/src/test/java/io/cloudslang/lang/systemtests/systemproperties/SensitiveSystemPropertiesTest.java @@ -113,8 +113,7 @@ public void testKeyNotStringd() throws Exception { RuntimeException exception = assertThrows(RuntimeException.class, () -> slang.loadSystemProperties(SlangSource.fromFile(propertiesFileUri))); - assertTrue(exception.getMessage().contains("Artifact {flow.var3_sensitive} has invalid value")); - assertTrue(exception.getMessage().contains("Value cannot be cast to Serializable")); + assertTrue(exception.getMessage().contains("Global tag is not allowed")); } private void testExecutable( diff --git a/pom.xml b/pom.xml index b24a938750..45db0d4999 100644 --- a/pom.xml +++ b/pom.xml @@ -269,7 +269,7 @@ org.yaml snakeyaml - 1.32 + 2.0