use of org.apache.ratis.server.DataStreamMap in project incubator-ratis by apache.
the class TestNettyDataStreamWithMock method mockDivision.
RaftServer.Division mockDivision(RaftServer server, RaftClient client) {
final RaftServer.Division division = mock(RaftServer.Division.class);
when(division.getRaftServer()).thenReturn(server);
when(division.getRaftClient()).thenReturn(client);
when(division.getRaftConf()).thenAnswer(i -> getRaftConf());
final MultiDataStreamStateMachine stateMachine = new MultiDataStreamStateMachine();
when(division.getStateMachine()).thenReturn(stateMachine);
final DataStreamMap streamMap = RaftServerTestUtil.newDataStreamMap(server.getId());
when(division.getDataStreamMap()).thenReturn(streamMap);
return division;
}
Aggregations