Update the sofa-jraft version to resolve the issue of the server cannot connect to the client (#11721)

* update sofa-jraft version

* fix JRaftServerTest.testRefreshRouteTable

* remove unnecessary Mockito stubbings
This commit is contained in:
dingjiefei 2024-02-27 14:40:28 +08:00 committed by GitHub
parent 889a78a82b
commit fdbc99dd99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -190,14 +190,12 @@ public class JRaftServerTest {
// Assign PeerId1 as the leader
final CliRequests.GetLeaderRequest.Builder rb = CliRequests.GetLeaderRequest.newBuilder();
rb.setGroupId(groupId);
final CliRequests.GetLeaderRequest getLeaderRequest = rb.build();
rb.build();
final FutureImpl<Message> getLeaderFuture = new FutureImpl<>();
final CliRequests.GetLeaderResponse.Builder gb = CliRequests.GetLeaderResponse.newBuilder();
gb.setLeaderId(peerId1.toString());
final CliRequests.GetLeaderResponse getLeaderResponse = gb.build();
getLeaderFuture.setResult(getLeaderResponse);
when(cliClientServiceMock.getLeader(peerId1.getEndpoint(), getLeaderRequest, null))
.thenReturn(getLeaderFuture);
}
private void mockcliService() {
@ -230,7 +228,7 @@ public class JRaftServerTest {
@Test
public void testRefreshRouteTable() {
server.refreshRouteTable(groupId);
verify(cliClientServiceMock, times(2)).connect(peerId1.getEndpoint());
verify(cliClientServiceMock, times(1)).connect(peerId1.getEndpoint());
verify(cliClientServiceMock).getLeader(eq(peerId1.getEndpoint()), any(CliRequests.GetLeaderRequest.class), eq(null));
}

View File

@ -147,7 +147,7 @@
<mockito-all.version>1.10.19</mockito-all.version>
<mockito-core.version>3.8.0</mockito-core.version>
<HikariCP.version>3.4.2</HikariCP.version>
<jraft-core.version>1.3.12</jraft-core.version>
<jraft-core.version>1.3.14</jraft-core.version>
<rpc-grpc-impl.version>${jraft-core.version}</rpc-grpc-impl.version>
<SnakeYaml.version>2.0</SnakeYaml.version>
</properties>