This is an automated email from the ASF dual-hosted git repository.

funky-eyes pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new c92f96fe68 feature: server: spring-boot upgrade to 4.0.6 (#8137)
c92f96fe68 is described below

commit c92f96fe682ea5b519e4f5b8fbdcaf4a5ad14b83
Author: 徐晓伟 <[email protected]>
AuthorDate: Thu Jun 25 17:04:41 2026 +0800

    feature: server: spring-boot upgrade to 4.0.6 (#8137)
---
 changes/en-us/2.x.md                               |  2 ++
 changes/zh-cn/2.x.md                               |  2 ++
 extensions/apm/pom.xml                             | 16 +++++++++--
 pom.xml                                            | 17 ++++++++++--
 server/pom.xml                                     |  9 ++++--
 .../main/java/org/apache/seata/server/Server.java  |  2 +-
 .../java/org/apache/seata/server/ServerRunner.java |  4 +--
 .../cluster/manager/ClusterWatcherManager.java     |  2 +-
 .../cluster/raft/context/SeataClusterContext.java  |  5 ++--
 .../apache/seata/server/config/ServerConfig.java   |  2 +-
 .../controller/BranchSessionController.java        |  3 +-
 .../console/controller/GlobalLockController.java   |  3 +-
 .../controller/GlobalSessionController.java        |  3 +-
 .../impl/db/GlobalSessionDBServiceImpl.java        |  2 +-
 .../seata/server/controller/ClusterController.java |  2 +-
 .../instance/AbstractSeataInstanceStrategy.java    |  8 +++---
 .../instance/RaftServerInstanceStrategy.java       |  3 +-
 .../server/storage/redis/JedisPooledFactory.java   |  8 +++---
 .../redis/store/RedisTransactionStoreManager.java  |  3 +-
 server/src/main/resources/logback-spring.xml       |  6 ++++
 .../org/apache/seata/server/LoaderConfTest.java    |  9 +++---
 .../impl/db/BranchSessionDBServiceImplTest.java    |  4 +--
 .../impl/db/GlobalLockDBServiceImplTest.java       |  4 +--
 .../impl/db/GlobalSessionDBServiceImplTest.java    |  6 ++--
 .../instance/RaftServerInstanceStrategyTest.java   |  2 +-
 .../apache/seata/server/lock/LockManagerTest.java  |  2 +-
 .../apache/seata/server/logging/AppenderTest.java  | 32 ++++++++++++++--------
 .../server/session/FileSessionManagerTest.java     |  2 +-
 .../server/session/redis/RedisQueryConsolTest.java |  3 +-
 .../storage/redis/JedisPooledFactoryTest.java      | 12 ++++----
 .../store/RedisTransactionStoreManagerTest.java    |  5 ++--
 31 files changed, 112 insertions(+), 71 deletions(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index ea951fedff..e8ffacf603 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -30,6 +30,7 @@ Add changes here for all PR submitted to the 2.x branch.
 
 
 ### optimize:
+- [[#8137](https://github.com/apache/incubator-seata/pull/8137)] server 
modules: spring-boot upgrade to 4.0.6
 
 
 ### security:
@@ -49,6 +50,7 @@ Thanks to these contributors for their code commits. Please 
report an unintended
 <!-- Please make sure your Github ID is in the list below -->
 
 - [slievrly](https://github.com/slievrly)
+- [xuxiaowei-com-cn](https://github.com/xuxiaowei-com-cn)
 - [Seol-JY](https://github.com/Seol-JY)
 - [lhozy](https://github.com/lhozy)
 - [Zhengcy05](https://github.com/Zhengcy05)
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index c775406572..77a68bc3fa 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -29,6 +29,7 @@
 
 
 ### optimize:
+- [[#8137](https://github.com/apache/incubator-seata/pull/8137)] server 模块: 
spring-boot 升级到 4.0.6
 
 
 ### security:
@@ -48,6 +49,7 @@
 <!-- 请确保您的 GitHub ID 在以下列表中 -->
 
 - [slievrly](https://github.com/slievrly)
+- [xuxiaowei-com-cn](https://github.com/xuxiaowei-com-cn)
 - [Seol-JY](https://github.com/Seol-JY)
 - [lhozy](https://github.com/lhozy)
 - [Zhengcy05](https://github.com/Zhengcy05)
diff --git a/extensions/apm/pom.xml b/extensions/apm/pom.xml
index 8778b913ad..94b5a2a230 100644
--- a/extensions/apm/pom.xml
+++ b/extensions/apm/pom.xml
@@ -33,6 +33,18 @@
     <description>APM extensions for Seata built with Maven</description>
 
     <modules>
-        <module>apm-seata-skywalking-plugin</module>
+        <!--<module>apm-seata-skywalking-plugin</module>-->
     </modules>
-</project>
\ No newline at end of file
+    <profiles>
+        <!-- profile: onlyBuildOnJDK17+ -->
+        <profile>
+            <id>JDK17Plus</id>
+            <activation>
+                <jdk>[17,)</jdk>
+            </activation>
+            <modules>
+                <module>apm-seata-skywalking-plugin</module>
+            </modules>
+        </profile>
+    </profiles>
+</project>
diff --git a/pom.xml b/pom.xml
index 05129717f4..47dfb4bc7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,10 +57,10 @@
         <module>compressor</module>
         <module>saga</module>
         <module>sqlparser</module>
-        <module>server</module>
+        <!--<module>server</module>-->
         <module>integration-tx-api</module>
 <!--        <module>namingserver</module>-->
-        <module>test-suite/test-new-version</module>
+        <!--<module>test-suite/test-new-version</module>-->
         <module>test-suite/test-old-version</module>
         <module>test-suite/seata-benchmark-cli</module>
         <module>json-common</module>
@@ -129,6 +129,17 @@
     </dependencyManagement>
 
     <profiles>
+        <!-- profile: onlyBuildOnJDK17+ -->
+        <profile>
+            <id>JDK17Plus</id>
+            <activation>
+                <jdk>[17,)</jdk>
+            </activation>
+            <modules>
+                <module>server</module>
+                <module>test-suite/test-new-version</module>
+            </modules>
+        </profile>
         <!-- profile: onlyBuildOnJDK21+ -->
         <profile>
             <id>JDK21Plus</id>
@@ -372,7 +383,7 @@
             </activation>
             <modules>
                 <module>distribution</module>
-                <module>test-suite/test-new-version</module>
+                <!--<module>test-suite/test-new-version</module>-->
                 <module>test-suite/test-old-version</module>
             </modules>
         </profile>
diff --git a/server/pom.xml b/server/pom.xml
index 9de1f40786..b7cd48a58c 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -32,9 +32,10 @@
     <description>server for Seata built with Maven</description>
 
     <properties>
-        <spring-boot-for-server.version>2.7.18</spring-boot-for-server.version>
-        
<spring-framework-for-server.version>5.3.39</spring-framework-for-server.version>
+        <spring-boot-for-server.version>4.0.6</spring-boot-for-server.version>
+        
<spring-framework-for-server.version>7.0.7</spring-framework-for-server.version>
         <snakeyaml-for-server.version>2.0</snakeyaml-for-server.version>
+        <junit-jupiter.version>6.0.3</junit-jupiter.version>
     </properties>
 
     <dependencyManagement>
@@ -97,6 +98,10 @@
 
     <dependencies>
         <!-- springboot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-web-server</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter</artifactId>
diff --git a/server/src/main/java/org/apache/seata/server/Server.java 
b/server/src/main/java/org/apache/seata/server/Server.java
index 9c2a579495..279ec87f5d 100644
--- a/server/src/main/java/org/apache/seata/server/Server.java
+++ b/server/src/main/java/org/apache/seata/server/Server.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.XID;
 import org.apache.seata.common.holder.ObjectHolder;
 import org.apache.seata.common.thread.ThreadPoolExecutorFactory;
@@ -35,7 +36,6 @@ import org.springframework.context.ApplicationListener;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
 import java.util.Optional;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
diff --git a/server/src/main/java/org/apache/seata/server/ServerRunner.java 
b/server/src/main/java/org/apache/seata/server/ServerRunner.java
index 94545399a5..a363a726e7 100644
--- a/server/src/main/java/org/apache/seata/server/ServerRunner.java
+++ b/server/src/main/java/org/apache/seata/server/ServerRunner.java
@@ -16,19 +16,19 @@
  */
 package org.apache.seata.server;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.core.rpc.Disposable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
 import org.springframework.context.ApplicationEvent;
 import org.springframework.context.ApplicationListener;
 import org.springframework.core.Ordered;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
diff --git 
a/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
 
b/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
index 9d1ac984ab..1ad8ae0e83 100644
--- 
a/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
+++ 
b/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java
@@ -31,6 +31,7 @@ import io.netty.handler.codec.http2.DefaultHttp2DataFrame;
 import io.netty.handler.codec.http2.DefaultHttp2Headers;
 import io.netty.handler.codec.http2.DefaultHttp2HeadersFrame;
 import io.netty.handler.codec.http2.Http2Headers;
+import jakarta.annotation.PostConstruct;
 import org.apache.seata.common.ConfigurationKeys;
 import org.apache.seata.common.Constants;
 import org.apache.seata.common.metadata.MetadataResponse;
@@ -51,7 +52,6 @@ import org.springframework.context.event.EventListener;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.PostConstruct;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashSet;
diff --git 
a/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
 
b/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
index 0f783a1b1b..a982570793 100644
--- 
a/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
+++ 
b/server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java
@@ -16,14 +16,13 @@
  */
 package org.apache.seata.server.cluster.raft.context;
 
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
 import org.apache.seata.common.ConfigurationKeys;
 import org.apache.seata.config.ConfigurationFactory;
 import org.apache.seata.core.context.ContextCore;
 import org.apache.seata.core.context.ContextCoreLoader;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import static org.apache.seata.common.DefaultValues.DEFAULT_SEATA_GROUP;
 
 /**
diff --git 
a/server/src/main/java/org/apache/seata/server/config/ServerConfig.java 
b/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
index 067666e1d8..9cc7e309d7 100644
--- a/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
+++ b/server/src/main/java/org/apache/seata/server/config/ServerConfig.java
@@ -16,7 +16,7 @@
  */
 package org.apache.seata.server.config;
 
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
diff --git 
a/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
 
b/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
index 5b82b605a1..1510551dd1 100644
--- 
a/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
+++ 
b/server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.console.controller;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.result.SingleResult;
 import org.apache.seata.server.console.service.BranchSessionService;
 import org.slf4j.Logger;
@@ -25,8 +26,6 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-
 /**
  * Branch Session Controller
  */
diff --git 
a/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
 
b/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
index fb7e3054f0..ec37b3b210 100644
--- 
a/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
+++ 
b/server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.console.controller;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.result.PageResult;
 import org.apache.seata.common.result.SingleResult;
 import org.apache.seata.server.console.entity.param.GlobalLockParam;
@@ -29,8 +30,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-
 /**
  * Global Lock Controller
  */
diff --git 
a/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
 
b/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
index a7703bc410..48c5531c47 100644
--- 
a/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
+++ 
b/server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.console.controller;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.result.PageResult;
 import org.apache.seata.common.result.SingleResult;
 import org.apache.seata.server.console.entity.param.GlobalSessionParam;
@@ -30,8 +31,6 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-
 /**
  * Global Session Controller
  */
diff --git 
a/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
 
b/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
index 16e772e7d1..1acaf08791 100644
--- 
a/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
+++ 
b/server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.console.impl.db;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.ConfigurationKeys;
 import org.apache.seata.common.exception.StoreException;
 import org.apache.seata.common.loader.EnhancedServiceLoader;
@@ -36,7 +37,6 @@ import 
org.apache.seata.server.console.service.GlobalSessionService;
 import 
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
 import javax.sql.DataSource;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
diff --git 
a/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
 
b/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
index b3f124bebc..ef875f0eca 100644
--- 
a/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
+++ 
b/server/src/main/java/org/apache/seata/server/controller/ClusterController.java
@@ -18,6 +18,7 @@ package org.apache.seata.server.controller;
 
 import com.alipay.sofa.jraft.RouteTable;
 import com.alipay.sofa.jraft.conf.Configuration;
+import jakarta.annotation.Resource;
 import org.apache.seata.common.metadata.MetadataResponse;
 import org.apache.seata.common.result.Result;
 import org.apache.seata.common.rpc.http.HttpContext;
@@ -31,7 +32,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
 import java.util.Map;
 
 @RestController
diff --git 
a/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
 
b/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
index fd73951901..48dc7ef50c 100644
--- 
a/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
+++ 
b/server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java
@@ -16,6 +16,9 @@
  */
 package org.apache.seata.server.instance;
 
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
+import jakarta.annotation.Resource;
 import org.apache.seata.common.metadata.Instance;
 import org.apache.seata.common.thread.ThreadPoolExecutorFactory;
 import org.apache.seata.core.protocol.Version;
@@ -25,12 +28,9 @@ import 
org.apache.seata.spring.boot.autoconfigure.properties.registry.RegistryNa
 import 
org.apache.seata.spring.boot.autoconfigure.properties.registry.RegistryProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
 import org.springframework.context.ApplicationContext;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.Optional;
 import java.util.concurrent.ScheduledExecutorService;
diff --git 
a/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
 
b/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
index 230933baa4..a231e64830 100644
--- 
a/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
+++ 
b/server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java
@@ -17,6 +17,7 @@
 package org.apache.seata.server.instance;
 
 import com.alipay.sofa.jraft.entity.PeerId;
+import jakarta.annotation.Resource;
 import org.apache.seata.common.XID;
 import org.apache.seata.common.holder.ObjectHolder;
 import org.apache.seata.common.metadata.ClusterRole;
@@ -36,8 +37,6 @@ import org.springframework.core.env.EnumerablePropertySource;
 import org.springframework.core.env.PropertySource;
 import org.springframework.scheduling.annotation.Async;
 
-import javax.annotation.Resource;
-
 import static org.apache.seata.common.ConfigurationKeys.META_PREFIX;
 import static 
org.apache.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;
 
diff --git 
a/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
 
b/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
index 583f30275e..e9ce9a004e 100644
--- 
a/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
+++ 
b/server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java
@@ -26,10 +26,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import redis.clients.jedis.Jedis;
 import redis.clients.jedis.JedisPool;
-import redis.clients.jedis.JedisPoolAbstract;
 import redis.clients.jedis.JedisPoolConfig;
 import redis.clients.jedis.JedisSentinelPool;
 import redis.clients.jedis.Protocol;
+import redis.clients.jedis.util.Pool;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -47,7 +47,7 @@ public class JedisPooledFactory {
      */
     protected static final Logger LOGGER = 
LoggerFactory.getLogger(JedisPooledFactory.class);
 
-    private static volatile JedisPoolAbstract jedisPool = null;
+    private static volatile Pool<Jedis> jedisPool = null;
 
     private static final String HOST = "127.0.0.1";
 
@@ -63,11 +63,11 @@ public class JedisPooledFactory {
      *
      * @return redisPool
      */
-    public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... 
jedisPools) {
+    public static Pool<Jedis> getJedisPoolInstance(Pool<Jedis>... jedisPools) {
         if (jedisPool == null) {
             synchronized (JedisPooledFactory.class) {
                 if (jedisPool == null) {
-                    JedisPoolAbstract tempJedisPool = null;
+                    Pool<Jedis> tempJedisPool = null;
                     if (jedisPools != null && jedisPools.length > 0) {
                         tempJedisPool = jedisPools[0];
                     } else {
diff --git 
a/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
 
b/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
index f5d1407094..c27ebc1dae 100644
--- 
a/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
+++ 
b/server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java
@@ -54,7 +54,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
-import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -500,7 +499,7 @@ public class RedisTransactionStoreManager extends 
AbstractTransactionStoreManage
         // queryCount
         final long queryCount = Math.min(logQueryLimit, countGlobalSessions);
         try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
-            Set<String> values = jedis.zrangeByScore(
+            List<String> values = jedis.zrangeByScore(
                     REDIS_SEATA_BEGIN_TRANSACTIONS_KEY, 0, 
System.currentTimeMillis(), 0, (int) queryCount);
             List<Map<String, String>> rep;
             try (Pipeline pipeline = jedis.pipelined()) {
diff --git a/server/src/main/resources/logback-spring.xml 
b/server/src/main/resources/logback-spring.xml
index 880cb91011..a303251e67 100644
--- a/server/src/main/resources/logback-spring.xml
+++ b/server/src/main/resources/logback-spring.xml
@@ -155,6 +155,12 @@
         </if>
 
     </root>
+    <logger name="org.apache.kafka" level="WARN" additivity="false">
+        <appender-ref ref="ASYNC_CONSOLE"/>
+        <appender-ref ref="ASYNC_FILE_ALL"/>
+        <appender-ref ref="ASYNC_FILE_WARN"/>
+        <appender-ref ref="ASYNC_FILE_ERROR"/>
+    </logger>
     <logger 
name="org.springframework.security.config.annotation.web.builders.WebSecurity" 
level="ERROR"/>
     <logger name="org.springframework.security.web.DefaultSecurityFilterChain" 
level="ERROR"/>
 </configuration>
diff --git a/server/src/test/java/org/apache/seata/server/LoaderConfTest.java 
b/server/src/test/java/org/apache/seata/server/LoaderConfTest.java
index 811615dcf0..1125715a82 100644
--- a/server/src/test/java/org/apache/seata/server/LoaderConfTest.java
+++ b/server/src/test/java/org/apache/seata/server/LoaderConfTest.java
@@ -16,12 +16,13 @@
  */
 package org.apache.seata.server;
 
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.env.Environment;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  *
  */
@@ -42,10 +43,10 @@ public class LoaderConfTest extends BaseSpringBootTest {
     @Test
     public void checkConf() {
         String nacosServerAddr = 
environment.resolveRequiredPlaceholders("${seata.config.nacos.serverAddr:localhost}");
-        Assertions.assertEquals(nacosServerAddr, "127.0.0.1:8848");
+        assertEquals("127.0.0.1:8848", nacosServerAddr);
         String nacosNamespace = 
environment.resolveRequiredPlaceholders("${seata.config.nacos.namespace:seata-group}");
-        Assertions.assertEquals(nacosNamespace, "seata-test");
+        assertEquals("seata-test", nacosNamespace);
         String undologSaveDays = 
environment.resolveRequiredPlaceholders("${seata.server.undo.log-save-days:7}");
-        Assertions.assertEquals(undologSaveDays, "2");
+        assertEquals("2", undologSaveDays);
     }
 }
diff --git 
a/server/src/test/java/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImplTest.java
 
b/server/src/test/java/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImplTest.java
index 7d34b978ac..b8d2ef935f 100644
--- 
a/server/src/test/java/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImplTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImplTest.java
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.bean.override.mockito.MockitoBean;
 import org.springframework.test.util.ReflectionTestUtils;
 
 import javax.sql.DataSource;
@@ -49,7 +49,7 @@ class BranchSessionDBServiceImplTest extends 
BaseSpringBootTest {
     @Autowired
     private BranchSessionDBServiceImpl branchSessionDBService;
 
-    @MockBean
+    @MockitoBean
     private DataSource dataSource;
 
     private Connection connection;
diff --git 
a/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalLockDBServiceImplTest.java
 
b/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalLockDBServiceImplTest.java
index 6c60f7aac9..03e8fb675d 100644
--- 
a/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalLockDBServiceImplTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalLockDBServiceImplTest.java
@@ -27,8 +27,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.bean.override.mockito.MockitoBean;
 import org.springframework.test.util.ReflectionTestUtils;
 
 import javax.sql.DataSource;
@@ -52,7 +52,7 @@ class GlobalLockDBServiceImplTest extends BaseSpringBootTest {
     @Autowired
     private GlobalLockDBServiceImpl globalLockDBService;
 
-    @MockBean
+    @MockitoBean
     private DataSource dataSource;
 
     private Connection connection;
diff --git 
a/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImplTest.java
 
b/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImplTest.java
index c91abfcdf4..3b29ea4311 100644
--- 
a/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImplTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImplTest.java
@@ -27,8 +27,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.bean.override.mockito.MockitoBean;
 import org.springframework.test.util.ReflectionTestUtils;
 
 import javax.sql.DataSource;
@@ -51,10 +51,10 @@ class GlobalSessionDBServiceImplTest extends 
BaseSpringBootTest {
     @Autowired
     private GlobalSessionDBServiceImpl globalSessionDBService;
 
-    @MockBean
+    @MockitoBean
     private DataSource dataSource;
 
-    @MockBean
+    @MockitoBean
     private BranchSessionService branchSessionService;
 
     private Connection connection;
diff --git 
a/server/src/test/java/org/apache/seata/server/instance/RaftServerInstanceStrategyTest.java
 
b/server/src/test/java/org/apache/seata/server/instance/RaftServerInstanceStrategyTest.java
index d5d59d94fb..07d9f63603 100644
--- 
a/server/src/test/java/org/apache/seata/server/instance/RaftServerInstanceStrategyTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/instance/RaftServerInstanceStrategyTest.java
@@ -40,7 +40,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.MockedStatic;
 import org.mockito.Mockito;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.core.env.MapPropertySource;
 import org.springframework.core.env.MutablePropertySources;
diff --git 
a/server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java 
b/server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java
index e045d0437e..568d56dad5 100644
--- a/server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java
+++ b/server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.lock;
 
+import jakarta.annotation.Resource;
 import org.apache.seata.common.result.PageResult;
 import org.apache.seata.common.store.SessionMode;
 import org.apache.seata.common.util.CollectionUtils;
@@ -38,7 +39,6 @@ import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
 import org.springframework.context.ApplicationContext;
 
-import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Collection;
diff --git 
a/server/src/test/java/org/apache/seata/server/logging/AppenderTest.java 
b/server/src/test/java/org/apache/seata/server/logging/AppenderTest.java
index 894959e499..bf9a1a3fd2 100644
--- a/server/src/test/java/org/apache/seata/server/logging/AppenderTest.java
+++ b/server/src/test/java/org/apache/seata/server/logging/AppenderTest.java
@@ -24,33 +24,37 @@ import 
net.logstash.logback.appender.LogstashTcpSocketAppender;
 import org.apache.seata.server.BaseSpringBootTest;
 import org.apache.seata.server.logging.logback.appender.MetricLogbackAppender;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.slf4j.impl.StaticLoggerBinder;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.TestPropertySource;
 
 import java.lang.reflect.Field;
 import java.util.Iterator;
 
+@TestPropertySource(
+        properties = {
+            "logging.extend.logstash-appender.enabled=true",
+            "logging.extend.kafka-appender.enabled=true",
+            "logging.extend.kafka-appender.topic=test",
+            "logging.extend.metric-appender.enabled=true"
+        })
 public class AppenderTest extends BaseSpringBootTest {
 
-    @BeforeAll
-    public static void init() {
-        System.setProperty("logging.extend.logstash-appender.enabled", "true");
-        System.setProperty("logging.extend.kafka-appender.enabled", "true");
-        System.setProperty("logging.extend.kafka-appender.topic", "test");
-        System.setProperty("logging.extend.metric-appender.enabled", "true");
-    }
-
     @Test
     public void testAppenderEnabled() {
-        LoggerContext lc = (LoggerContext) 
StaticLoggerBinder.getSingleton().getLoggerFactory();
+        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
         Iterator<Appender<ILoggingEvent>> appenderIterator =
                 lc.getLogger("ROOT").iteratorForAppenders();
 
+        boolean kafkaFound = false;
+        boolean metricFound = false;
+        boolean logstashFound = false;
+
         while (appenderIterator.hasNext()) {
             Appender<ILoggingEvent> appender = appenderIterator.next();
             if (appender.getName().equals("KAFKA")) {
                 KafkaAppender<ILoggingEvent> kafkaAppender = 
(KafkaAppender<ILoggingEvent>) appender;
+                kafkaFound = true;
 
                 try {
                     // use reflection to obtain the "protect topic" fields of 
the abstract class inherited by the
@@ -69,12 +73,18 @@ public class AppenderTest extends BaseSpringBootTest {
 
             if (appender.getName().equals("METRIC")) {
                 Assertions.assertInstanceOf(MetricLogbackAppender.class, 
appender);
+                metricFound = true;
             }
 
             if (appender.getName().equals("LOGSTASH")) {
                 Assertions.assertInstanceOf(LogstashTcpSocketAppender.class, 
appender);
+                logstashFound = true;
             }
         }
+
+        Assertions.assertTrue(kafkaFound);
+        Assertions.assertTrue(metricFound);
+        Assertions.assertTrue(logstashFound);
     }
 
     private static Field getDeclaredFieldRecursive(Class<?> clazz, String 
fieldName) throws NoSuchFieldException {
diff --git 
a/server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java
 
b/server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java
index f4c22f7b44..77de755c64 100644
--- 
a/server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.seata.server.session;
 
+import jakarta.annotation.Resource;
 import org.apache.commons.lang3.time.DateUtils;
 import org.apache.seata.common.XID;
 import org.apache.seata.common.loader.EnhancedServiceLoader;
@@ -43,7 +44,6 @@ import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
 import org.springframework.context.ApplicationContext;
 
-import javax.annotation.Resource;
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
diff --git 
a/server/src/test/java/org/apache/seata/server/session/redis/RedisQueryConsolTest.java
 
b/server/src/test/java/org/apache/seata/server/session/redis/RedisQueryConsolTest.java
index b21babacd0..19602acecd 100644
--- 
a/server/src/test/java/org/apache/seata/server/session/redis/RedisQueryConsolTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/session/redis/RedisQueryConsolTest.java
@@ -17,6 +17,7 @@
 package org.apache.seata.server.session.redis;
 
 import com.alibaba.fastjson.JSON;
+import jakarta.annotation.Resource;
 import org.apache.seata.common.result.PageResult;
 import org.apache.seata.server.BaseSpringBootTest;
 import org.apache.seata.server.console.entity.param.GlobalLockParam;
@@ -28,8 +29,6 @@ import 
org.apache.seata.server.console.service.GlobalSessionService;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
-import javax.annotation.Resource;
-
 /**
  */
 @EnabledIfSystemProperty(named = "redisCaseEnabled", matches = "true")
diff --git 
a/server/src/test/java/org/apache/seata/server/storage/redis/JedisPooledFactoryTest.java
 
b/server/src/test/java/org/apache/seata/server/storage/redis/JedisPooledFactoryTest.java
index 2f82489552..e794766bd8 100644
--- 
a/server/src/test/java/org/apache/seata/server/storage/redis/JedisPooledFactoryTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/storage/redis/JedisPooledFactoryTest.java
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 import redis.clients.jedis.Jedis;
 import redis.clients.jedis.JedisPool;
-import redis.clients.jedis.JedisPoolAbstract;
 import redis.clients.jedis.JedisPoolConfig;
+import redis.clients.jedis.util.Pool;
 
 import java.lang.reflect.Field;
 
@@ -37,7 +37,7 @@ public class JedisPooledFactoryTest extends 
BaseSpringBootTest {
         // Reset the singleton jedisPool field to null before each test to 
ensure test isolation
         Field jedisPoolField = 
JedisPooledFactory.class.getDeclaredField("jedisPool");
         jedisPoolField.setAccessible(true);
-        JedisPoolAbstract existingPool = (JedisPoolAbstract) 
jedisPoolField.get(null);
+        Pool<Jedis> existingPool = (Pool<Jedis>) jedisPoolField.get(null);
 
         // Close existing pool if present to prevent resource leaks
         if (existingPool != null) {
@@ -53,7 +53,7 @@ public class JedisPooledFactoryTest extends 
BaseSpringBootTest {
         // Clean up resources after each test
         Field jedisPoolField = 
JedisPooledFactory.class.getDeclaredField("jedisPool");
         jedisPoolField.setAccessible(true);
-        JedisPoolAbstract pool = (JedisPoolAbstract) jedisPoolField.get(null);
+        Pool<Jedis> pool = (Pool<Jedis>) jedisPoolField.get(null);
 
         if (pool != null) {
             pool.close();
@@ -72,7 +72,7 @@ public class JedisPooledFactoryTest extends 
BaseSpringBootTest {
 
         JedisPool jedisPool = new JedisPool(poolConfig, "127.0.0.1", 6379, 
60000);
 
-        JedisPoolAbstract poolInstance = 
JedisPooledFactory.getJedisPoolInstance(jedisPool);
+        Pool<Jedis> poolInstance = 
JedisPooledFactory.getJedisPoolInstance(jedisPool);
 
         Assertions.assertNotNull(poolInstance);
         Assertions.assertEquals(jedisPool, poolInstance);
@@ -86,8 +86,8 @@ public class JedisPooledFactoryTest extends 
BaseSpringBootTest {
 
         JedisPool jedisPool = new JedisPool(poolConfig, "127.0.0.1", 6379, 
60000);
 
-        JedisPoolAbstract instance1 = 
JedisPooledFactory.getJedisPoolInstance(jedisPool);
-        JedisPoolAbstract instance2 = 
JedisPooledFactory.getJedisPoolInstance();
+        Pool<Jedis> instance1 = 
JedisPooledFactory.getJedisPoolInstance(jedisPool);
+        Pool<Jedis> instance2 = JedisPooledFactory.getJedisPoolInstance();
 
         Assertions.assertNotNull(instance1);
         Assertions.assertNotNull(instance2);
diff --git 
a/server/src/test/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManagerTest.java
 
b/server/src/test/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManagerTest.java
index 3ad93bfeee..ed4c2961ce 100644
--- 
a/server/src/test/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManagerTest.java
+++ 
b/server/src/test/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManagerTest.java
@@ -29,7 +29,6 @@ import redis.clients.jedis.Jedis;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 @EnabledIfSystemProperty(named = "redisCaseEnabled", matches = "true")
 public class RedisTransactionStoreManagerTest extends BaseSpringBootTest {
@@ -254,7 +253,7 @@ public class RedisTransactionStoreManagerTest extends 
BaseSpringBootTest {
             Assertions.assertTrue(statusList.contains("testGlobalXid:111"));
 
             // Verify timeout sorted set
-            Set<String> timeoutSet = 
jedis.zrangeByScore("SEATA_BEGIN_TRANSACTIONS", 0, Double.MAX_VALUE);
+            List<String> timeoutSet = 
jedis.zrangeByScore("SEATA_BEGIN_TRANSACTIONS", 0, Double.MAX_VALUE);
             Assertions.assertTrue(timeoutSet.contains(globalKey));
 
             // Cleanup
@@ -292,7 +291,7 @@ public class RedisTransactionStoreManagerTest extends 
BaseSpringBootTest {
             List<String> statusList = jedis.lrange(statusKey, 0, -1);
             Assertions.assertFalse(statusList.contains("testGlobalXid:222"));
 
-            Set<String> timeoutSet = 
jedis.zrangeByScore("SEATA_BEGIN_TRANSACTIONS", 0, Double.MAX_VALUE);
+            List<String> timeoutSet = 
jedis.zrangeByScore("SEATA_BEGIN_TRANSACTIONS", 0, Double.MAX_VALUE);
             Assertions.assertFalse(timeoutSet.contains(globalKey));
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to