X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FRaftActorDelegatingPersistentDataProviderTest.java;h=22369d78870b64b2d1a3ebce71bdac2b795a5aaf;hb=88a7f904602133bb803752848bb58c9b0a3e9792;hp=287d86c3062f6290a0d5aa04c20f679cb71391f2;hpb=e1eca73a5ae2ffae8dd78c6fe5281cd2f45d5ef3;p=controller.git 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 287d86c306..22369d7887 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,7 +7,7 @@ */ package org.opendaylight.controller.cluster.raft; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -15,19 +15,21 @@ import static org.mockito.Mockito.verify; import akka.japi.Procedure; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.controller.cluster.DataPersistenceProvider; import org.opendaylight.controller.cluster.PersistentDataProvider; -import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload; -import org.opendaylight.controller.cluster.raft.protobuff.client.messages.PersistentPayload; +import org.opendaylight.controller.cluster.raft.messages.Payload; +import org.opendaylight.controller.cluster.raft.messages.PersistentPayload; /** * Unit tests for RaftActorDelegatingPersistentDataProvider. * * @author Thomas Pantelis */ +@RunWith(MockitoJUnitRunner.StrictStubs.class) public class RaftActorDelegatingPersistentDataProviderTest { private static final Payload PERSISTENT_PAYLOAD = new TestPersistentPayload(); @@ -55,7 +57,6 @@ public class RaftActorDelegatingPersistentDataProviderTest { @Before public void setup() { - MockitoAnnotations.initMocks(this); doReturn(PERSISTENT_PAYLOAD).when(mockPersistentLogEntry).getData(); doReturn(NON_PERSISTENT_PAYLOAD).when(mockNonPersistentLogEntry).getData(); provider = new RaftActorDelegatingPersistentDataProvider(mockDelegateProvider, mockPersistentProvider); @@ -97,12 +98,28 @@ public class RaftActorDelegatingPersistentDataProviderTest { } static class TestNonPersistentPayload extends Payload { + @java.io.Serial + private static final long serialVersionUID = 1L; + @Override public int size() { return 0; } + + @Override + public int serializedSize() { + return 0; + } + + @Override + protected Object writeReplace() { + // Not needed + throw new UnsupportedOperationException(); + } } static class TestPersistentPayload extends TestNonPersistentPayload implements PersistentPayload { + @java.io.Serial + private static final long serialVersionUID = 1L; } }