import com.google.common.util.concurrent.Uninterruptibles;
import java.util.ArrayDeque;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Deque;
+import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import org.eclipse.jdt.annotation.NonNull;
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().getRootIdentifier(), rootNode.getDataBefore(),
- rootNode.getDataAfter()));
+ rootNode.modificationType(), mod.getRootPath().path(), rootNode.dataBefore(),
+ rootNode.dataAfter()));
return;
}
}
private boolean synced;
@Override
- public synchronized void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
+ public synchronized void onDataTreeChanged(final List<DataTreeModification<T>> changes) {
accumulatedChanges.addAll(changes);
synced = true;
}
protected final <T extends DataObject> @NonNull ModificationCollector<T> createCollector(
final LogicalDatastoreType store, final InstanceIdentifier<T> path) {
final var listener = new TestListener<T>();
- final var reg = getDataBroker().registerDataTreeChangeListener(DataTreeIdentifier.create(store, path),
- listener);
+ final var reg = getDataBroker().registerDataTreeChangeListener(DataTreeIdentifier.of(store, path), listener);
listener.awaitSync();
return new ModificationCollector<>(listener, reg);
}
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()
- && path.equals(modification.getRootPath().getRootIdentifier())
- && checkDataBefore.apply(modification.getRootNode().getDataBefore())
- && checkDataAfter.apply(modification.getRootNode().getDataAfter());
+ return modification -> type == modification.getRootNode().modificationType()
+ && path.equals(modification.getRootPath().path())
+ && checkDataBefore.apply(modification.getRootNode().dataBefore())
+ && checkDataAfter.apply(modification.getRootNode().dataAfter());
}
public static <T extends DataObject> @NonNull Matcher<T> match(final ModificationType type,