From 2e806c9094df1cc35830a5f3525961161c5593f0 Mon Sep 17 00:00:00 2001 From: yx9o Date: Sat, 4 Jan 2025 16:03:10 +0800 Subject: [PATCH] Update --- .../proxy/grpc/ProxyAndTlsProtocolNegotiatorTest.java | 8 ++++++++ .../test/java/org/apache/rocketmq/remoting/TlsTest.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/proxy/src/test/java/org/apache/rocketmq/proxy/grpc/ProxyAndTlsProtocolNegotiatorTest.java b/proxy/src/test/java/org/apache/rocketmq/proxy/grpc/ProxyAndTlsProtocolNegotiatorTest.java index 699491f03d1..741122af646 100644 --- a/proxy/src/test/java/org/apache/rocketmq/proxy/grpc/ProxyAndTlsProtocolNegotiatorTest.java +++ b/proxy/src/test/java/org/apache/rocketmq/proxy/grpc/ProxyAndTlsProtocolNegotiatorTest.java @@ -21,6 +21,8 @@ import io.grpc.netty.shaded.io.netty.buffer.Unpooled; import io.grpc.netty.shaded.io.netty.handler.codec.haproxy.HAProxyTLV; import java.nio.charset.StandardCharsets; + +import org.apache.rocketmq.common.MixAll; import org.apache.rocketmq.proxy.config.ConfigurationManager; import org.junit.Before; import org.junit.Test; @@ -34,6 +36,9 @@ public class ProxyAndTlsProtocolNegotiatorTest { @Before public void setUp() throws Exception { + if (!MixAll.isJdk8()) { + return; + } ConfigurationManager.intConfig(); ConfigurationManager.getProxyConfig().setTlsTestModeEnable(true); negotiator = new ProxyAndTlsProtocolNegotiator(); @@ -41,6 +46,9 @@ public void setUp() throws Exception { @Test public void handleHAProxyTLV() { + if (!MixAll.isJdk8()) { + return; + } ByteBuf content = Unpooled.buffer(); content.writeBytes("xxxx".getBytes(StandardCharsets.UTF_8)); HAProxyTLV haProxyTLV = new HAProxyTLV((byte) 0xE1, content); diff --git a/remoting/src/test/java/org/apache/rocketmq/remoting/TlsTest.java b/remoting/src/test/java/org/apache/rocketmq/remoting/TlsTest.java index a4890d73d5a..da6c119240b 100644 --- a/remoting/src/test/java/org/apache/rocketmq/remoting/TlsTest.java +++ b/remoting/src/test/java/org/apache/rocketmq/remoting/TlsTest.java @@ -17,6 +17,7 @@ package org.apache.rocketmq.remoting; +import org.apache.rocketmq.common.MixAll; import org.apache.rocketmq.common.utils.NetworkUtil; import org.apache.rocketmq.remoting.common.TlsMode; import org.apache.rocketmq.remoting.exception.RemotingSendRequestException; @@ -281,6 +282,9 @@ public void clientAcceptsUntrustedServerCert() throws Exception { @Test public void testTlsConfigThroughFile() throws Exception { + if (!MixAll.isJdk8()) { + return; + } File file = tempFolder.newFile("tls.config"); tlsTestModeEnable = true;