Skip to content

Commit 5b4a5f2

Browse files
committed
adapter to snakeyaml 2.0
1 parent 69702e7 commit 5b4a5f2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config/ConfigReader.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@
1616
*/
1717
package org.apache.seata.config;
1818

19+
import java.io.File;
20+
import java.io.IOException;
21+
import java.io.InputStream;
22+
import java.nio.file.Files;
23+
1924
import org.apache.seata.model.E2EConfig;
2025
import org.apache.seata.model.E2EWrapper;
26+
import org.yaml.snakeyaml.LoaderOptions;
2127
import org.yaml.snakeyaml.Yaml;
2228
import org.yaml.snakeyaml.constructor.Constructor;
2329

24-
import java.io.*;
25-
import java.nio.file.Files;
26-
2730
/**
2831
* @author jingliu_xiong@foxmail.com
2932
*/
3033
public class ConfigReader {
3134
public static E2EConfig readConfig(File configFile) throws IOException {
32-
Yaml yaml = new Yaml(new Constructor(E2EWrapper.class));
35+
LoaderOptions loaderOptions = new LoaderOptions();
36+
Yaml yaml = new Yaml(new Constructor(E2EWrapper.class, loaderOptions));
3337
E2EWrapper e2EWrapper = new E2EWrapper();
3438
InputStream inputStream = Files.newInputStream(configFile.toPath());
3539
// 从YAML文件读取数据并转换为Java对象

0 commit comments

Comments
 (0)