package org.opendaylight.mdsal.binding.dom.adapter;
import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyCollection;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
public void testChoiceDataTreeModificationAddressable() throws InterruptedException, ExecutionException {
final DataTreeChangeListener<WithChoice> listener = assertWrittenWithChoice();
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, ADDRESSABLE_CASE, new AddressableBuilder().build());
final DataTreeChangeListener<AddressableCont> listener = assertWrittenContainer(AddressableCont.QNAME,
AddressableCont.class, new AddressableContBuilder().build());
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, ADDRESSABLE_CONTAINER.child(AddressableChild.class),
final DataTreeChangeListener<UnaddressableCont> listener = assertWrittenContainer(UnaddressableCont.QNAME,
UnaddressableCont.class, new UnaddressableContBuilder().build());
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
final DOMDataTreeWriteTransaction domTx = getDomBroker().newWriteOnlyTransaction();
domTx.put(CONFIGURATION, YangInstanceIdentifier.create(UNADDRESSABLE_CONTAINER_NID)
public void testChoiceDataTreeModificationUnaddressable() throws InterruptedException, ExecutionException {
final DataTreeChangeListener<WithChoice> listener = assertWrittenWithChoice();
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
final DOMDataTreeWriteTransaction domTx = getDomBroker().newWriteOnlyTransaction();
domTx.put(CONFIGURATION, YangInstanceIdentifier.create(CHOICE_CONTAINER_NID).node(Foo.QNAME),
final Class<T> bindingClass, final T expected)
throws InterruptedException, ExecutionException {
final DataTreeChangeListener<T> listener = mock(DataTreeChangeListener.class);
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
final DataTreeIdentifier<T> dti = DataTreeIdentifier.create(CONFIGURATION,
InstanceIdentifier.create(bindingClass));
assertEquals(List.of(), changedContainer.getModifiedChildren());
reset(listener);
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
return listener;
}
private DataTreeChangeListener<WithChoice> assertWrittenWithChoice() throws InterruptedException,
ExecutionException {
final DataTreeChangeListener<WithChoice> listener = mock(DataTreeChangeListener.class);
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
getDataBroker().registerDataTreeChangeListener(CHOICE_CONTAINER_TID, listener);
final DOMDataTreeWriteTransaction domTx = getDomBroker().newWriteOnlyTransaction();
assertEquals(List.of(), changedContainer.getModifiedChildren());
reset(listener);
- doNothing().when(listener).onDataTreeChanged(any(Collection.class));
+ doNothing().when(listener).onDataTreeChanged(anyCollection());
return listener;
}