Update SimpleShardDataTreeCohortTest 60/96760/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 1 Jul 2021 08:32:42 +0000 (10:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 1 Jul 2021 08:33:13 +0000 (10:33 +0200)
Use MockitoJUnitRunner instead of MockitoAnnotations.initMocks().

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

index 94617ed..65cf2ea 100644 (file)
@@ -23,8 +23,9 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.Future;
 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.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
@@ -37,6 +38,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailed
  *
  * @author Thomas Pantelis
  */
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
 public class SimpleShardDataTreeCohortTest extends AbstractTest {
     @Mock
     private ShardDataTree mockShardDataTree;
@@ -54,8 +56,6 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest {
 
     @Before
     public void setup() {
-        MockitoAnnotations.initMocks(this);
-
         doReturn(Optional.empty()).when(mockUserCohorts).commit();
         doReturn(Optional.empty()).when(mockUserCohorts).abort();