Migrate AbstractProxyTransactionTest to MockitoJUnitRunner 75/98475/2
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Nov 2021 16:14:32 +0000 (17:14 +0100)
committerRobert Varga <nite@hq.sk>
Sat, 13 Nov 2021 16:59:31 +0000 (16:59 +0000)
Do not use Mockito.openMocks(), but rather a proper runner.

Change-Id: I26d9d15cd10f8717c7bc36ccb91591a70305bda2
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/AbstractProxyTransactionTest.java

index b13bbe7..167c5bc 100644 (file)
@@ -33,8 +33,9 @@ import org.hamcrest.Description;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.controller.cluster.access.ABIVersion;
 import org.opendaylight.controller.cluster.access.client.AbstractClientConnection;
 import org.opendaylight.controller.cluster.access.client.AccessClientUtil;
 import org.opendaylight.controller.cluster.access.ABIVersion;
 import org.opendaylight.controller.cluster.access.client.AbstractClientConnection;
 import org.opendaylight.controller.cluster.access.client.AccessClientUtil;
@@ -66,6 +67,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeM
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
 public abstract class AbstractProxyTransactionTest<T extends AbstractProxyTransaction> {
     protected static final TransactionIdentifier TRANSACTION_ID = TestUtils.TRANSACTION_ID;
     private static final ClientIdentifier CLIENT_ID = TestUtils.CLIENT_ID;
 public abstract class AbstractProxyTransactionTest<T extends AbstractProxyTransaction> {
     protected static final TransactionIdentifier TRANSACTION_ID = TestUtils.TRANSACTION_ID;
     private static final ClientIdentifier CLIENT_ID = TestUtils.CLIENT_ID;
@@ -101,7 +103,6 @@ public abstract class AbstractProxyTransactionTest<T extends AbstractProxyTransa
 
     @Before
     public void setUp() {
 
     @Before
     public void setUp() {
-        MockitoAnnotations.initMocks(this);
         system = ActorSystem.apply();
         clientContextProbe = new TestProbe(system, "clientContext");
         backendProbe = new TestProbe(system, "backend");
         system = ActorSystem.apply();
         clientContextProbe = new TestProbe(system, "clientContext");
         backendProbe = new TestProbe(system, "backend");