Eliminate IntegrationTestKit subclasses
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / sharding / DistributedShardFrontendTest.java
index b71095808468428e295cd1a155095b466529dba8..a907724f552e9a386f0454f8c6edf4368d99d8e1 100644 (file)
@@ -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);
@@ -149,10 +149,10 @@ public class DistributedShardFrontendTest {
 
         final DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(Collections.singletonList(ROOT));
         final DOMDataTreeCursorAwareTransaction tx = producer.createTransaction(false);
-        final DOMDataTreeWriteCursor cursor = tx.createCursor(ROOT);
+        final DOMDataTreeWriteCursor txCursor = tx.createCursor(ROOT);
 
-        assertNotNull(cursor);
-        cursor.write(TestModel.TEST_PATH.getLastPathArgument(), createCrossShardContainer());
+        assertNotNull(txCursor);
+        txCursor.write(TestModel.TEST_PATH.getLastPathArgument(), createCrossShardContainer());
 
         //check the lower shard got the correct modification
         verify(outerListCursor, times(2)).write(pathArgumentCaptor.capture(), nodeCaptor.capture());
@@ -171,13 +171,12 @@ public class DistributedShardFrontendTest {
         final MapNode actualInnerListNode = (MapNode) nodeCaptor.getAllValues().get(1);
         assertEquals(createInnerMapNode(1), actualInnerListNode);
 
-        cursor.close();
-        tx.submit().checkedGet();
+        txCursor.close();
+        tx.commit().get();
 
         verify(commitCohort, times(2)).canCommit();
         verify(commitCohort, times(2)).preCommit();
         verify(commitCohort, times(2)).commit();
-
     }
 
     private static MapNode createInnerMapNode(final int id) {