From f6c23ee7ff64c8055e7b37377effb00faedaa5f0 Mon Sep 17 00:00:00 2001 From: v_nikeyang <1013195908@qq.com> Date: Wed, 11 Oct 2023 14:19:19 +0800 Subject: [PATCH] fix code review --- .../factory/TestFlinkEngineConnFactory.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linkis-engineconn-plugins/flink/src/test/scala/org.apache.linkis.engineconnplugin.flink/factory/TestFlinkEngineConnFactory.scala b/linkis-engineconn-plugins/flink/src/test/scala/org.apache.linkis.engineconnplugin.flink/factory/TestFlinkEngineConnFactory.scala index 43faa71d16..ef8dabf14e 100644 --- a/linkis-engineconn-plugins/flink/src/test/scala/org.apache.linkis.engineconnplugin.flink/factory/TestFlinkEngineConnFactory.scala +++ b/linkis-engineconn-plugins/flink/src/test/scala/org.apache.linkis.engineconnplugin.flink/factory/TestFlinkEngineConnFactory.scala @@ -17,7 +17,7 @@ package org.apache.linkis.engineconnplugin.flink.factory -import org.apache.linkis.engineconnplugin.flink.config.FlinkEnvConfiguration.{FLINK_CONF_DIR, FLINK_CONF_YAML} +import org.apache.linkis.engineconnplugin.flink.config.FlinkEnvConfiguration.{FLINK_CONF_DIR, FLINK_CONF_YAML, FLINK_ENV_JAVA_OPTS} import org.apache.linkis.engineconnplugin.flink.util.FlinkValueFormatUtil import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test @@ -40,8 +40,8 @@ class TestFlinkEngineConnFactory { val yamlContent = source.mkString val yaml = new Yaml() val configMap = yaml.loadAs(yamlContent, classOf[util.LinkedHashMap[String, Object]]) - if (configMap.containsKey("env.java.opts")) { - defaultJavaOpts = configMap.get("env.java.opts").toString + if (configMap.containsKey(FLINK_ENV_JAVA_OPTS.getValue)) { + defaultJavaOpts = configMap.get(FLINK_ENV_JAVA_OPTS.getValue).toString } } finally { source.close() @@ -54,8 +54,8 @@ class TestFlinkEngineConnFactory { val yamlContent = source.mkString val yaml = new Yaml() val configMap = yaml.loadAs(yamlContent, classOf[util.LinkedHashMap[String, Object]]) - if (configMap.containsKey("env.java.opts")) { - defaultJavaOpts = configMap.get("env.java.opts").toString + if (configMap.containsKey(FLINK_ENV_JAVA_OPTS.getValue)) { + defaultJavaOpts = configMap.get(FLINK_ENV_JAVA_OPTS.getValue).toString } } finally { source.close()