X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FMockRaftActor.java;h=74112458635b5994fe36557264fe9895fb3d9d0d;hb=dcc92fc8fdf056d5ada94931f2d24523070fd9a7;hp=c1a87e8c7b283e1f83b9114471dba911426127cb;hpb=2895ebebbc5178ff051b5611341444159dd69770;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActor.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActor.java index c1a87e8c7b..7411245863 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActor.java @@ -9,6 +9,8 @@ package org.opendaylight.controller.cluster.raft; import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; import akka.actor.ActorRef; import akka.actor.Props; @@ -49,8 +51,16 @@ public class MockRaftActor extends RaftActor implements RaftActorRecoveryCohort, super(builder.id, builder.peerAddresses, Optional.fromNullable(builder.config), PAYLOAD_VERSION); state = new ArrayList<>(); this.actorDelegate = mock(RaftActor.class); + doNothing().when(this.actorDelegate).onRecoveryComplete(); + doNothing().when(this.actorDelegate).onStateChanged(); + doNothing().when(this.actorDelegate).applyState(any(ActorRef.class), any(String.class), any(Object.class)); + this.recoveryCohortDelegate = mock(RaftActorRecoveryCohort.class); + doNothing().when(this.recoveryCohortDelegate).applyRecoverySnapshot(any(byte[].class)); + this.snapshotCohortDelegate = mock(RaftActorSnapshotCohort.class); + doNothing().when(this.snapshotCohortDelegate).applySnapshot(any(byte[].class)); + doNothing().when(this.snapshotCohortDelegate).createSnapshot(any(ActorRef.class)); if(builder.dataPersistenceProvider == null){ setPersistence(builder.persistent.isPresent() ? builder.persistent.get() : true);