Search in sources :

Example 1 with NetconfNotificationCollector

use of org.opendaylight.netconf.notifications.NetconfNotificationCollector in project netconf by opendaylight.

the class NotificationToMdsalWriterTest method setUp.

@Before
public void setUp() {
    final NetconfNotificationCollector notificationCollector = mock(NetconfNotificationCollector.class);
    doReturn(notificationRegistration).when(notificationCollector).registerStreamListener(any(NetconfNotificationCollector.NetconfNotificationStreamListener.class));
    WriteTransaction tx = mock(WriteTransaction.class);
    doNothing().when(tx).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(DataObject.class));
    doNothing().when(tx).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
    doReturn(emptyFluentFuture()).when(tx).commit();
    doReturn(tx).when(dataBroker).newWriteOnlyTransaction();
    writer = new NotificationToMdsalWriter(notificationCollector, dataBroker);
    writer.start();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) DataObject(org.opendaylight.yangtools.yang.binding.DataObject) NetconfNotificationCollector(org.opendaylight.netconf.notifications.NetconfNotificationCollector) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)1 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)1 NetconfNotificationCollector (org.opendaylight.netconf.notifications.NetconfNotificationCollector)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1