File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
e2e-test/e2e-test-builder/src/main/java/org/apache/seata/config Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .seata .config ;
18
18
19
+ import java .io .File ;
20
+ import java .io .IOException ;
21
+ import java .io .InputStream ;
22
+ import java .nio .file .Files ;
23
+
19
24
import org .apache .seata .model .E2EConfig ;
20
25
import org .apache .seata .model .E2EWrapper ;
26
+ import org .yaml .snakeyaml .LoaderOptions ;
21
27
import org .yaml .snakeyaml .Yaml ;
22
28
import org .yaml .snakeyaml .constructor .Constructor ;
23
29
24
- import java .io .*;
25
- import java .nio .file .Files ;
26
-
27
30
/**
28
31
* @author jingliu_xiong@foxmail.com
29
32
*/
30
33
public class ConfigReader {
31
34
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 ));
33
37
E2EWrapper e2EWrapper = new E2EWrapper ();
34
38
InputStream inputStream = Files .newInputStream (configFile .toPath ());
35
39
// 从YAML文件读取数据并转换为Java对象
You can’t perform that action at this time.
0 commit comments