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=378c53cb18a9ee92b7085a27e429afafd225f584;hp=e833f4350808db9663dd20fbe71d2faac7e95275;hb=aa9c756831b5392e1dec18a93b86cf9c28b73e8f;hpb=bd8bff811e5f2af4622e1543106c240db8e4b2f2;ds=sidebyside 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..378c53cb18 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,9 +7,6 @@ */ 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; @@ -19,8 +16,6 @@ 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 +51,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); }