X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FFollowerLogInformationImplTest.java;h=5be9030f5957bd361c73ead2d11353eb5d178f95;hb=fc89f3b66b3e5db73e09792bbecebf3156d70d20;hp=84d1545a65e3302462b69f9ee96f8dd982955654;hpb=e3998d55e33da9f6ecb69da75ecc71a047b6362b;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java index 84d1545a65..5be9030f59 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java @@ -7,29 +7,29 @@ */ package org.opendaylight.controller.cluster.raft; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import com.google.common.base.Stopwatch; import com.google.common.util.concurrent.Uninterruptibles; +import java.util.concurrent.TimeUnit; import org.junit.Test; import scala.concurrent.duration.FiniteDuration; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - public class FollowerLogInformationImplTest { @Test public void testIsFollowerActive() { - FiniteDuration timeoutDuration = - new FiniteDuration(500, TimeUnit.MILLISECONDS); - - FollowerLogInformation followerLogInformation = - new FollowerLogInformationImpl( - "follower1", 10, 9, timeoutDuration); + MockRaftActorContext context = new MockRaftActorContext(); + context.setCommitIndex(10); + DefaultConfigParamsImpl configParams = new DefaultConfigParamsImpl(); + configParams.setHeartBeatInterval(new FiniteDuration(500, TimeUnit.MILLISECONDS)); + configParams.setElectionTimeoutFactor(1); + context.setConfigParams(configParams); + FollowerLogInformation followerLogInformation = + new FollowerLogInformationImpl("follower1", 9, context); assertFalse("Follower should be termed inactive before stopwatch starts", followerLogInformation.isFollowerActive());