Fix unit test errors due to Mockito upgrade
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / MockRaftActorContext.java
index 5104fde125c518b86e50fe63d68a93cc087051d8..25d14a2b193120c4c5a98021f8c7ed76f5c42a45 100644 (file)
@@ -13,18 +13,12 @@ import akka.actor.ActorSelection;
 import akka.actor.ActorSystem;
 import akka.actor.Props;
 import akka.japi.Procedure;
-
-import com.google.protobuf.GeneratedMessage;
-
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.opendaylight.controller.cluster.NonPersistentDataProvider;
 import org.opendaylight.controller.cluster.raft.policy.RaftPolicy;
 import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
-import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages;
-import org.opendaylight.controller.protobuff.messages.cluster.raft.test.MockPayloadMessages;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -67,6 +61,7 @@ public class MockRaftActorContext extends RaftActorContextImpl {
     public MockRaftActorContext(){
         super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<String, String>(),
                 new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
+        setReplicatedLog(new MockReplicatedLogBuilder().build());
     }
 
     public MockRaftActorContext(String id, ActorSystem system, ActorRef actor){
@@ -185,28 +180,11 @@ public class MockRaftActorContext extends RaftActorContextImpl {
             this.size = size;
         }
 
-        @Override public Map<GeneratedMessage.GeneratedExtension<?, ?>, String> encode() {
-            Map<GeneratedMessage.GeneratedExtension<?, ?>, String> map = new HashMap<>();
-            map.put(MockPayloadMessages.value, value);
-            return map;
-        }
-
-        @Override public Payload decode(
-            AppendEntriesMessages.AppendEntries.ReplicatedLogEntry.Payload payloadProtoBuff) {
-            String value = payloadProtoBuff.getExtension(MockPayloadMessages.value);
-            this.value = value;
-            return this;
-        }
-
         @Override
         public int size() {
             return size;
         }
 
-        @Override public String getClientPayloadClassName() {
-            return MockPayload.class.getName();
-        }
-
         @Override
         public String toString() {
             return value;