Migrate DataTreeModification method users 30/110030/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jan 2024 13:58:52 +0000 (14:58 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jan 2024 13:58:52 +0000 (14:58 +0100)
Use new methods instead of the deprecated ones.

Change-Id: If56da4296584228d0e6d18482d0b8b6f2b871c20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/AbstractDataObjectModification.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/DataTreeChangeListenerTest.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/test/AbstractDataTreeChangeListenerTest.java

index 6fe65414f6a5806c997058b398be10d4dbcbfddc..94f24c047fc2d03f9a6ee6242ec6f3698bfcd2bf 100644 (file)
@@ -238,7 +238,7 @@ abstract sealed class AbstractDataObjectModification<T extends DataObject, N ext
     @SuppressWarnings("unchecked")
     private <C extends DataObject> Stream<LazyDataObjectModification<C>> streamModifiedChildren(
             final Class<C> childType) {
-        return getModifiedChildren().stream()
+        return modifiedChildren().stream()
             .filter(child -> childType.isAssignableFrom(child.dataType()))
             .map(child -> (LazyDataObjectModification<C>) child);
     }
index e2e03620b2481b6a4a52d8661a8c610e938941ac..f8b90e59094b4c1fc667905ef2dcbc4a1eee33a8 100644 (file)
@@ -162,14 +162,14 @@ public class DataTreeChangeListenerTest extends AbstractDataBrokerTest {
         final DataTreeModification<Top> initialWrite = Iterables.getOnlyElement(events);
         final DataObjectModification<? extends DataObject> initialNode = initialWrite.getRootNode();
         verifyModification(initialNode,TOP_PATH.getPathArguments().iterator().next(),ModificationType.WRITE);
-        assertEquals(TOP_INITIAL_DATA, initialNode.getDataAfter());
+        assertEquals(TOP_INITIAL_DATA, initialNode.dataAfter());
     }
 
     private static void verifyModification(final DataObjectModification<? extends DataObject> barWrite,
             final DataObjectStep<?> pathArg, final ModificationType eventType) {
-        assertEquals(pathArg.type(), barWrite.getDataType());
-        assertEquals(eventType,barWrite.getModificationType());
-        assertEquals(pathArg, barWrite.getIdentifier());
+        assertEquals(pathArg.type(), barWrite.dataType());
+        assertEquals(eventType,barWrite.modificationType());
+        assertEquals(pathArg, barWrite.step());
     }
 
     private <T extends DataObject> WriteTransaction putTx(final InstanceIdentifier<T> path, final T data) {
index e2b4887f836c2ed88ca2f83f76457538c085bbe3..b7db42fddfcc8e877c56635e27de77f0aa7dcd4f 100644 (file)
@@ -66,8 +66,8 @@ public class AbstractDataTreeChangeListenerTest extends AbstractConcurrentDataBr
                 if (!matcher.apply(mod)) {
                     final var rootNode = mod.getRootNode();
                     fail("Received unexpected notification: type: %s, path: %s, before: %s, after: %s".formatted(
-                        rootNode.getModificationType(), mod.getRootPath().path(), rootNode.getDataBefore(),
-                        rootNode.getDataAfter()));
+                        rootNode.modificationType(), mod.getRootPath().path(), rootNode.dataBefore(),
+                        rootNode.dataAfter()));
                     return;
                 }
             }
@@ -163,10 +163,10 @@ public class AbstractDataTreeChangeListenerTest extends AbstractConcurrentDataBr
     public static <T extends DataObject> @NonNull Matcher<T> match(final ModificationType type,
             final InstanceIdentifier<T> path, final DataMatcher<T> checkDataBefore,
             final DataMatcher<T> checkDataAfter) {
-        return modification -> type == modification.getRootNode().getModificationType()
+        return modification -> type == modification.getRootNode().modificationType()
                 && path.equals(modification.getRootPath().path())
-                && checkDataBefore.apply(modification.getRootNode().getDataBefore())
-                && checkDataAfter.apply(modification.getRootNode().getDataAfter());
+                && checkDataBefore.apply(modification.getRootNode().dataBefore())
+                && checkDataAfter.apply(modification.getRootNode().dataAfter());
     }
 
     public static <T extends DataObject> @NonNull Matcher<T> match(final ModificationType type,