Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / test / java / org / opendaylight / mdsal / dom / store / inmemory / InMemoryDOMDataTreeShardThreePhaseCommitCohortTest.java
index b7a47226a50c885a1511e1842911707255f068ef..a86b342d0591f1081290c61d7e6ebfade0f6b5c5 100644 (file)
@@ -8,7 +8,8 @@
 package org.opendaylight.mdsal.dom.store.inmemory;
 
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -22,26 +23,25 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutionException;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateTip;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType;
 
 public class InMemoryDOMDataTreeShardThreePhaseCommitCohortTest {
 
-    private static final DataTreeCandidate DATA_TREE_CANDIDATE = mock(DataTreeCandidate.class);
+    private static final DataTreeCandidateTip DATA_TREE_CANDIDATE = mock(DataTreeCandidateTip.class);
     private static final DataTreeCandidateNode DATA_TREE_CANDIDATE_NODE = mock(DataTreeCandidateNode.class);
     private static final DataTreeModification DATA_TREE_MODIFICATION = mock(DataTreeModification.class);
     private static final InMemoryDOMDataTreeShardChangePublisher IN_MEMORY_DOM_DATA_TREE_SHARD_CHANGE_PUBLISHER =
             new InMemoryDOMDataTreeShardChangePublisher(MoreExecutors.directExecutor(), 1, DATA_TREE,
-                    YangInstanceIdentifier.of(QName.create("test")), ImmutableMap.of());
+                    YangInstanceIdentifier.of(QName.create("", "test")), ImmutableMap.of());
     private static final InMemoryDOMDataTreeShardThreePhaseCommitCohort
             IN_MEMORY_DOM_DATA_TREE_SHARD_THREE_PHASE_COMMIT_COHORT =
                 new InMemoryDOMDataTreeShardThreePhaseCommitCohort(DATA_TREE, DATA_TREE_MODIFICATION,
@@ -49,7 +49,7 @@ public class InMemoryDOMDataTreeShardThreePhaseCommitCohortTest {
 
     @Before
     public void setUp() throws Exception {
-        doReturn(YangInstanceIdentifier.EMPTY).when(DATA_TREE_CANDIDATE).getRootPath();
+        doReturn(YangInstanceIdentifier.empty()).when(DATA_TREE_CANDIDATE).getRootPath();
         doReturn("testDataTreeCandidate").when(DATA_TREE_CANDIDATE).toString();
         doReturn(DATA_TREE_CANDIDATE_NODE).when(DATA_TREE_CANDIDATE).getRootNode();
         doReturn(DATA_TREE_CANDIDATE).when(DATA_TREE).prepare(any());
@@ -85,7 +85,7 @@ public class InMemoryDOMDataTreeShardThreePhaseCommitCohortTest {
         doThrow(new RuntimeException("testException")).when(DATA_TREE).prepare(any());
         try {
             IN_MEMORY_DOM_DATA_TREE_SHARD_THREE_PHASE_COMMIT_COHORT.preCommit().get();
-            Assert.fail("Expected Exception");
+            fail("Expected Exception");
         } catch (ExecutionException e) {
             assertTrue(e.getCause().getMessage().contains("testException"));
         }
@@ -93,7 +93,7 @@ public class InMemoryDOMDataTreeShardThreePhaseCommitCohortTest {
 
     @Test
     public void canCommitWithDataValidationFailedExceptionTest() throws Exception {
-        doThrow(new DataValidationFailedException(YangInstanceIdentifier.EMPTY, "testException"))
+        doThrow(new DataValidationFailedException(YangInstanceIdentifier.empty(), "testException"))
                 .when(DATA_TREE).validate(any());
         try {
             IN_MEMORY_DOM_DATA_TREE_SHARD_THREE_PHASE_COMMIT_COHORT.canCommit().get();
@@ -107,7 +107,7 @@ public class InMemoryDOMDataTreeShardThreePhaseCommitCohortTest {
         doThrow(new RuntimeException("testException")).when(DATA_TREE).validate(any());
         try {
             IN_MEMORY_DOM_DATA_TREE_SHARD_THREE_PHASE_COMMIT_COHORT.canCommit().get();
-            Assert.fail("Expected Exception");
+            fail("Expected Exception");
         } catch (ExecutionException e) {
             assertTrue(e.getCause().getMessage().contains("testException"));
         }