Fix unit test errors due to Mockito upgrade
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / FollowerLogInformationImplTest.java
index b89f28f40166c113243972267e51e5b1ba595577..843b9bebbd3956a3bda56c251a03e697bbc72867 100644 (file)
@@ -64,6 +64,7 @@ public class FollowerLogInformationImplTest {
     @Test
     public void testOkToReplicate(){
         MockRaftActorContext context = new MockRaftActorContext();
+        context.setCommitIndex(0);
         FollowerLogInformation followerLogInformation =
                 new FollowerLogInformationImpl(new PeerInfo("follower1", null, VotingState.VOTING), 10, context);
 
@@ -83,6 +84,7 @@ public class FollowerLogInformationImplTest {
     public void testVotingNotInitializedState() {
         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);
 
         assertFalse(followerLogInformation.okToReplicate());
@@ -101,6 +103,7 @@ public class FollowerLogInformationImplTest {
     public void testNonVotingState() {
         final PeerInfo peerInfo = new PeerInfo("follower1", null, VotingState.NON_VOTING);
         MockRaftActorContext context = new MockRaftActorContext();
+        context.setCommitIndex(0);
         FollowerLogInformation followerLogInformation = new FollowerLogInformationImpl(peerInfo, -1, context);
 
         assertTrue(followerLogInformation.okToReplicate());