@SuppressWarnings("unchecked") @Test public void testClose() { DOMNotificationRouter spiedNotificationRouter = spy(domNotificationRouter); ListenerRegistration<?> mocklListenerReg = mock(ListenerRegistration.class); doReturn(mocklListenerReg).when(spiedNotificationRouter).registerNotificationListener( any(), any(Collection.class)); YangNotificationCollectorLogger logger = new YangNotificationCollectorLogger(mockSpiService, schedulerService, domSchemaService, spiedNotificationRouter, new NotificationSubscriptionBuilder().setNotifications( Arrays.asList(new NotificationsBuilder().setNotification( OutOfPixieDustNotification.QNAME.toString()).build())).build()); logger.close(); verify(mocklListenerReg).close(); spiedNotificationRouter = spy(domNotificationRouter); logger = new YangNotificationCollectorLogger(mockSpiService, schedulerService, domSchemaService, spiedNotificationRouter, new NotificationSubscriptionBuilder().build()); logger.close(); verify(spiedNotificationRouter, never()).registerNotificationListener(any(), any(Collection.class)); }
@Override public void close() { LOG.debug("Closing..."); super.close(); if (notificationReg != null) { notificationReg.close(); } }
YangNotificationCollectorLogger extends BatchingLogCollector implements DOMNotificationListener { @Override public void close() { LOG.debug("Closing..."); super.close(); if (notificationReg != null) { notificationReg.close(); } } }
YangNotificationCollectorLogger extends BatchingLogCollector implements DOMNotificationListener { @Override public void close() { LOG.debug("Closing..."); super.close(); if (notificationReg != null) { notificationReg.close(); } } @Inject  YangNotificationCollectorLogger(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final DOMSchemaService domSchemaService,
            final DOMNotificationService notificationService, final NotificationSubscription configuration); }
YangNotificationCollectorLogger extends BatchingLogCollector implements DOMNotificationListener { @Override public void close() { LOG.debug("Closing..."); super.close(); if (notificationReg != null) { notificationReg.close(); } } @Inject  YangNotificationCollectorLogger(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final DOMSchemaService domSchemaService,
            final DOMNotificationService notificationService, final NotificationSubscription configuration); @Override void close(); @Override void onNotification(DOMNotification notification); }
YangNotificationCollectorLogger extends BatchingLogCollector implements DOMNotificationListener { @Override public void close() { LOG.debug("Closing..."); super.close(); if (notificationReg != null) { notificationReg.close(); } } @Inject  YangNotificationCollectorLogger(final TsdrCollectorSpiService collectorSPIService,
            final SchedulerService schedulerService, final DOMSchemaService domSchemaService,
            final DOMNotificationService notificationService, final NotificationSubscription configuration); @Override void close(); @Override void onNotification(DOMNotification notification);  }