X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FMockRaftActorContext.java;h=2e05a7e5708b49381082353518b81cd299521f4f;hp=f4f2b9f6a8d8e31bbf8719ab4e33683fb178cda2;hb=ed0c0135e2563fbbfcec41975338cece15c62cc2;hpb=7f16cee52c607089a05d19f14a33c28a3e82df97 diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java index f4f2b9f6a8..2e05a7e570 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.function.Consumer; +import org.opendaylight.controller.cluster.DataPersistenceProvider; import org.opendaylight.controller.cluster.NonPersistentDataProvider; import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior; import org.opendaylight.controller.cluster.raft.persisted.ByteState; @@ -67,16 +68,19 @@ public class MockRaftActorContext extends RaftActorContextImpl { }; } + private static DataPersistenceProvider createProvider() { + return new NonPersistentDataProvider(Runnable::run); + } + public MockRaftActorContext() { super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<>(), - new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), applyState -> { }, LOG); + new DefaultConfigParamsImpl(), createProvider(), applyState -> { }, LOG); setReplicatedLog(new MockReplicatedLogBuilder().build()); } public MockRaftActorContext(final String id, final ActorSystem system, final ActorRef actor) { super(actor, null, id, newElectionTerm(), -1, -1, new HashMap<>(), - new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), - applyState -> actor.tell(applyState, actor), LOG); + new DefaultConfigParamsImpl(), createProvider(), applyState -> actor.tell(applyState, actor), LOG); this.system = system;