Migrate AbstractClientHandleTest 80/98480/2
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Nov 2021 17:16:20 +0000 (18:16 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Nov 2021 18:10:38 +0000 (19:10 +0100)
Mockito.initMocks() is deprecated, migrate to using mockito runner.

Change-Id: I6fbf7dd3502ed054701a1f6f41cd26e537b163e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java

index f332bcf..7cd191e 100644 (file)
@@ -26,8 +26,9 @@ import java.util.Map;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.controller.cluster.access.client.AbstractClientConnection;
 import org.opendaylight.controller.cluster.access.client.AccessClientUtil;
 import org.opendaylight.controller.cluster.access.client.ClientActorContext;
@@ -50,8 +51,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
 import scala.concurrent.Promise;
 
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
 public abstract class AbstractClientHandleTest<T extends AbstractClientHandle<AbstractProxyTransaction>> {
-
     private static final String PERSISTENCE_ID = "per-1";
     private static final YangInstanceIdentifier PATH = YangInstanceIdentifier.empty();
 
@@ -67,7 +68,6 @@ public abstract class AbstractClientHandleTest<T extends AbstractClientHandle<Ab
 
     @Before
     public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
         system = ActorSystem.apply();
         final TestProbe contextProbe = new TestProbe(system, "context");
         final TestProbe clientContextProbe = new TestProbe(system, "client-context");