Clean up ClientBackedReadTransactionTest 82/98482/3
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Nov 2021 17:36:24 +0000 (18:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Nov 2021 19:19:32 +0000 (20:19 +0100)
Use mockito junit runner instead of initMocks().

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

index c56209f..bcaedfa 100644 (file)
@@ -17,13 +17,15 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Optional;
 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.ClientActorContext;
 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientSnapshot;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
 public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest<ClientBackedReadTransaction> {
     private ClientBackedReadTransaction object;
 
@@ -41,9 +43,6 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
 
     @Before
     public void setUp() {
-        MockitoAnnotations.initMocks(this);
-
-        doReturn(CLIENT_ID).when(clientContext).getIdentifier();
         doReturn(TRANSACTION_ID).when(delegate).getIdentifier();
 
         doReturn(immediateTrueFluentFuture()).when(delegate).exists(YangInstanceIdentifier.empty());