GetEntriesResult entriesResult = new GetEntriesResult(0L, 0L, Collections.<Entry>emptyList());
when(mockRaftLog.getEntriesFrom(anyLong(), anyInt())).thenReturn(entriesResult);
ReplicaManager replicaManager = new ReplicaManager(mockClient, mockRaftLog, FOLLOWER);
ListenableFuture f1 = replicaManager.requestUpdate();
AppendEntries appendEntries = AppendEntries.newBuilder()
.setLeaderId(SELF.toString())
.setCommitIndex(0)
.setPrevLogIndex(0)
.setPrevLogTerm(0)
.setTerm(1)
.build();
verify(mockClient, times(1)).appendEntries(FOLLOWER, appendEntries);
verifyNoMoreInteractions(mockClient);
verify(mockRaftLog, times(1)).getEntriesFrom(1, 1);
assertTrue(replicaManager.isRunning());
assertFalse(replicaManager.isRequested());
assertEquals(1, replicaManager.getNextIndex());
ListenableFuture f2 = replicaManager.requestUpdate();
assertNotSame(f1, f2);
assertTrue(replicaManager.isRunning());
assertTrue(replicaManager.isRequested());
assertEquals(1, replicaManager.getNextIndex());