import org.junit.Test;
import scala.concurrent.duration.FiniteDuration;
-public class FollowerLogInformationImplTest {
+public class FollowerLogInformationTest {
@Test
public void testIsFollowerActive() {
context.setConfigParams(configParams);
FollowerLogInformation followerLogInformation =
- new FollowerLogInformationImpl(new PeerInfo("follower1", null, VotingState.VOTING), 9, context);
+ new FollowerLogInformation(new PeerInfo("follower1", null, VotingState.VOTING), 9, context);
assertFalse("Follower should be termed inactive before stopwatch starts",
followerLogInformation.isFollowerActive());
MockRaftActorContext context = new MockRaftActorContext();
context.setCommitIndex(0);
FollowerLogInformation followerLogInformation =
- new FollowerLogInformationImpl(new PeerInfo("follower1", null, VotingState.VOTING), 10, context);
+ new FollowerLogInformation(new PeerInfo("follower1", null, VotingState.VOTING), 10, context);
assertTrue(followerLogInformation.okToReplicate());
assertFalse(followerLogInformation.okToReplicate());
final PeerInfo peerInfo = new PeerInfo("follower1", null, VotingState.VOTING_NOT_INITIALIZED);
MockRaftActorContext context = new MockRaftActorContext();
context.setCommitIndex(0);
- FollowerLogInformation followerLogInformation = new FollowerLogInformationImpl(peerInfo, -1, context);
+ FollowerLogInformation followerLogInformation = new FollowerLogInformation(peerInfo, context);
assertFalse(followerLogInformation.okToReplicate());
final PeerInfo peerInfo = new PeerInfo("follower1", null, VotingState.NON_VOTING);
MockRaftActorContext context = new MockRaftActorContext();
context.setCommitIndex(0);
- FollowerLogInformation followerLogInformation = new FollowerLogInformationImpl(peerInfo, -1, context);
+ FollowerLogInformation followerLogInformation = new FollowerLogInformation(peerInfo, context);
assertTrue(followerLogInformation.okToReplicate());
MockRaftActorContext context = new MockRaftActorContext();
context.setCommitIndex(1);
FollowerLogInformation followerLogInformation =
- new FollowerLogInformationImpl(new PeerInfo("follower1", null, VotingState.VOTING), 1, context);
+ new FollowerLogInformation(new PeerInfo("follower1", null, VotingState.VOTING), 1, context);
assertTrue(followerLogInformation.decrNextIndex());
assertEquals("getNextIndex", 0, followerLogInformation.getNextIndex());