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%2FRaftActorDelegatingPersistentDataProviderTest.java;h=3b45e1184b644605927e84b192984b143bfa89dd;hp=e833f4350808db9663dd20fbe71d2faac7e95275;hb=24a5bafd22b83c4d838b7c3fc5225934fe969561;hpb=dcc92fc8fdf056d5ada94931f2d24523070fd9a7 diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java index e833f43508..3b45e1184b 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java @@ -7,20 +7,13 @@ */ package org.opendaylight.controller.cluster.raft; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.verify; import akka.japi.Procedure; -import com.google.protobuf.GeneratedMessage.GeneratedExtension; -import java.util.Map; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import org.opendaylight.controller.cluster.DataPersistenceProvider; import org.opendaylight.controller.cluster.PersistentDataProvider; import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload; @@ -56,24 +49,11 @@ public class RaftActorDelegatingPersistentDataProviderTest { private RaftActorDelegatingPersistentDataProvider provider; - @SuppressWarnings("unchecked") @Before - public void setup() throws Exception { + public void setup() { MockitoAnnotations.initMocks(this); doReturn(PERSISTENT_PAYLOAD).when(mockPersistentLogEntry).getData(); doReturn(NON_PERSISTENT_PAYLOAD).when(mockNonPersistentLogEntry).getData(); - - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocation) throws Exception { - final Object[] args = invocation.getArguments(); - ((Procedure)args[1]).apply(args[0]); - return null; - } - }).when(mockPersistentProvider).persist(any(Object.class), any(Procedure.class)); - - doNothing().when(mockDelegateProvider).persist(any(Object.class), any(Procedure.class)); - doNothing().when(mockProcedure).apply(any(Object.class)); provider = new RaftActorDelegatingPersistentDataProvider(mockDelegateProvider, mockPersistentProvider); } @@ -108,18 +88,6 @@ public class RaftActorDelegatingPersistentDataProviderTest { } static class TestNonPersistentPayload extends Payload { - @SuppressWarnings("rawtypes") - @Override - public Map encode() { - return null; - } - - @Override - public Payload decode( - org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages.AppendEntries.ReplicatedLogEntry.Payload payload) { - return null; - } - @Override public int size() { return 0;