Remove deprecated ShardDataTree#commit method
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / AbstractShardTest.java
index 05d9943622301212c4c1f222a834ef7eb181a81b..f5a7551176028427cbf6feb64270da4897696f0f 100644 (file)
@@ -55,7 +55,7 @@ import org.opendaylight.controller.cluster.datastore.modification.MergeModificat
 import org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification;
 import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
 import org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload;
-import org.opendaylight.controller.cluster.datastore.persisted.PreBoronShardDataTreeSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.MetadataShardDataTreeSnapshot;
 import org.opendaylight.controller.cluster.datastore.persisted.ShardSnapshotState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.TestActorFactory;
@@ -310,7 +310,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         BatchedModifications batched = newBatchedModifications(nextTransactionId(), id, node, true, true, 1);
         DataTreeModification modification = store.getDataTree().takeSnapshot().newModification();
         batched.apply(modification);
-        store.notifyListeners(store.commit(modification));
+        store.notifyListeners(commitTransaction(store.getDataTree(), modification));
     }
 
     public static void writeToStore(final DataTree store, final YangInstanceIdentifier id,
@@ -334,7 +334,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
 
         DataTreeModification modification = store.getDataTree().takeSnapshot().newModification();
         batched.apply(modification);
-        store.notifyListeners(store.commit(modification));
+        store.notifyListeners(commitTransaction(store.getDataTree(), modification));
     }
 
     DataTree setupInMemorySnapshotStore() throws DataValidationFailedException {
@@ -346,7 +346,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         final NormalizedNode<?, ?> root = readStore(testStore, YangInstanceIdentifier.EMPTY);
 
         InMemorySnapshotStore.addSnapshot(shardID.toString(), Snapshot.create(
-                new ShardSnapshotState(new PreBoronShardDataTreeSnapshot(root)),
+                new ShardSnapshotState(new MetadataShardDataTreeSnapshot(root)),
                 Collections.<ReplicatedLogEntry>emptyList(), 0, 1, -1, -1, 1, null, null));
         return testStore;
     }
@@ -406,11 +406,13 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         return mockCandidate;
     }
 
-    static void commitTransaction(final DataTree store, final DataTreeModification modification)
+    static DataTreeCandidate commitTransaction(final DataTree store, final DataTreeModification modification)
             throws DataValidationFailedException {
         modification.ready();
         store.validate(modification);
-        store.commit(store.prepare(modification));
+        final DataTreeCandidate candidate = store.prepare(modification);
+        store.commit(candidate);
+        return candidate;
     }
 
     @SuppressWarnings("serial")