From f364bedf9007877f3b94734bcfde5ca0c9ff3c05 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Fri, 7 Oct 2022 23:02:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96zk=E7=9A=84=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/zookeeper/ZkClusterWithXmlELSpringbootTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java index 9d5ba3d86..d1ff5c361 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java @@ -22,6 +22,7 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; /** * springboot环境下的zk cluster的测试 @@ -42,6 +43,7 @@ public class ZkClusterWithXmlELSpringbootTest extends BaseTest { @BeforeClass public static void setUpBeforeClass() throws Exception { + System.setProperty("zookeeper.admin.enableServer", "false"); zkCluster = new TestingCluster(new InstanceSpec(null, 21810, -1, -1, true, -1, -1, -1), new InstanceSpec(null, 21811, -1, -1, true, -1, -1, -1), new InstanceSpec(null, 21812, -1, -1, true, -1, -1, -1)); @@ -53,12 +55,12 @@ public class ZkClusterWithXmlELSpringbootTest extends BaseTest { zkClient.setZkSerializer(new ZkSerializer() { @Override public byte[] serialize(final Object o) throws ZkMarshallingError { - return o.toString().getBytes(Charset.forName("UTF-8")); + return o.toString().getBytes(StandardCharsets.UTF_8); } @Override public Object deserialize(final byte[] bytes) throws ZkMarshallingError { - return new String(bytes, Charset.forName("UTF-8")); + return new String(bytes, StandardCharsets.UTF_8); } }); zkClient.createPersistent(ZK_NODE_PATH, true);