BUG-509: reorganize data tree abstractions.
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / test / java / org / opendaylight / controller / md / sal / dom / store / impl / ModificationMetadataTreeTest.java
index e14699311bd33da365e923c6d76a66c4c6d17009..0445c47c6bcb29fa3825f9971bd8e50a8b7f9d45 100644 (file)
@@ -137,11 +137,9 @@ public class ModificationMetadataTreeTest {
 
     @Test
     public void basicReadWrites() {
 
     @Test
     public void basicReadWrites() {
-        MutableDataTree modificationTree = MutableDataTree.from(
-                DataAndMetadataSnapshot.builder() //
-                        .setMetadataTree(StoreMetadataNode.createRecursively(createDocumentOne(), UnsignedLong.valueOf(5))) //
-                        .setSchemaContext(schemaContext) //
-                        .build(), new SchemaAwareApplyOperationRoot(schemaContext));
+        MutableDataTree modificationTree = MutableDataTree.from(new DataTree.Snapshot(schemaContext,
+                StoreMetadataNode.createRecursively(createDocumentOne(), UnsignedLong.valueOf(5))),
+                new SchemaAwareApplyOperationRoot(schemaContext));
         Optional<NormalizedNode<?, ?>> originalBarNode = modificationTree.read(OUTER_LIST_2_PATH);
         assertTrue(originalBarNode.isPresent());
         assertSame(BAR_NODE, originalBarNode.get());
         Optional<NormalizedNode<?, ?>> originalBarNode = modificationTree.read(OUTER_LIST_2_PATH);
         assertTrue(originalBarNode.isPresent());
         assertSame(BAR_NODE, originalBarNode.get());
@@ -166,7 +164,7 @@ public class ModificationMetadataTreeTest {
         /**
          * Creates empty Snapshot with associated schema context.
          */
         /**
          * Creates empty Snapshot with associated schema context.
          */
-        DataAndMetadataSnapshot emptySnapshot = DataAndMetadataSnapshot.createEmpty(schemaContext);
+        DataTree t = DataTree.create(schemaContext);
 
         /**
          *
 
         /**
          *
@@ -174,7 +172,7 @@ public class ModificationMetadataTreeTest {
          * context.
          *
          */
          * context.
          *
          */
-        MutableDataTree modificationTree = MutableDataTree.from(emptySnapshot, new SchemaAwareApplyOperationRoot(
+        MutableDataTree modificationTree = MutableDataTree.from(t.takeSnapshot(), new SchemaAwareApplyOperationRoot(
                 schemaContext));
         return modificationTree;
     }
                 schemaContext));
         return modificationTree;
     }