Optimize anyxml output
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / sharding / DistributedShardFrontendTest.java
index 6a346202fb0469b4f0ad76441978ed1e1acebcb6..a567f0a13a1a29ec3c71b1a76e0d039d838d8e40 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.cluster.sharding;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -29,7 +29,7 @@ import org.opendaylight.controller.cluster.databroker.actors.dds.ClientLocalHist
 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
 import org.opendaylight.controller.cluster.databroker.actors.dds.DataStoreClient;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
-import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
+import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
 import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -64,7 +64,7 @@ public class DistributedShardFrontendTest {
     private DOMDataTreeWriteCursor cursor;
 
     private static final YangInstanceIdentifier OUTER_LIST_YID = TestModel.OUTER_LIST_PATH.node(
-            new NodeIdentifierWithPredicates(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1));
+            NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1));
     private static final DOMDataTreeIdentifier OUTER_LIST_ID =
             new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, OUTER_LIST_YID);
 
@@ -76,7 +76,7 @@ public class DistributedShardFrontendTest {
     private DOMStoreThreePhaseCommitCohort commitCohort;
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         MockitoAnnotations.initMocks(this);
         shardedDOMDataTree = new ShardedDOMDataTree();
         client = mock(DataStoreClient.class);
@@ -110,8 +110,8 @@ public class DistributedShardFrontendTest {
     public void testClientTransaction() throws Exception {
 
         final DistributedDataStore distributedDataStore = mock(DistributedDataStore.class);
-        final ActorContext context = mock(ActorContext.class);
-        doReturn(context).when(distributedDataStore).getActorContext();
+        final ActorUtils context = mock(ActorUtils.class);
+        doReturn(context).when(distributedDataStore).getActorUtils();
         doReturn(SchemaContextHelper.full()).when(context).getSchemaContext();
 
         final DistributedShardFrontend rootShard = new DistributedShardFrontend(distributedDataStore, client, ROOT);
@@ -172,7 +172,7 @@ public class DistributedShardFrontendTest {
         assertEquals(createInnerMapNode(1), actualInnerListNode);
 
         txCursor.close();
-        tx.submit().checkedGet();
+        tx.commit().get();
 
         verify(commitCohort, times(2)).canCommit();
         verify(commitCohort, times(2)).preCommit();