From fd2a4c778acc0d35712e9ebd73ef60e38cfacb8b Mon Sep 17 00:00:00 2001
From: huangli <areyouok@gmail.com>
Date: Wed, 8 Jan 2025 14:35:54 +0800
Subject: [PATCH] test: fix thread problem in test code

---
 .../github/dtprj/dongting/raft/server/TransferLeaderTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/src/test/java/com/github/dtprj/dongting/raft/server/TransferLeaderTest.java b/server/src/test/java/com/github/dtprj/dongting/raft/server/TransferLeaderTest.java
index 25b36827..b42ed199 100644
--- a/server/src/test/java/com/github/dtprj/dongting/raft/server/TransferLeaderTest.java
+++ b/server/src/test/java/com/github/dtprj/dongting/raft/server/TransferLeaderTest.java
@@ -47,8 +47,8 @@ void test() throws Exception {
         CompletableFuture<Void> f = leader.group.transferLeadership(newLeader.nodeId, 2000);
         f.get(5, TimeUnit.SECONDS);
 
-        assertEquals(RaftRole.follower, leader.group.getGroupComponents().getRaftStatus().getRole());
-        assertEquals(RaftRole.leader, newLeader.group.getGroupComponents().getRaftStatus().getRole());
+        assertEquals(RaftRole.follower, leader.group.getGroupComponents().getRaftStatus().getShareStatus().role);
+        assertEquals(RaftRole.leader, newLeader.group.getGroupComponents().getRaftStatus().getShareStatus().role);
 
         put(newLeader, "k1", "v1");