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:
parent
889a78a82b
commit
fdbc99dd99
@ -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));
|
||||
}
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user