use of org.opendaylight.netconf.api.monitoring.SessionListener in project netconf by opendaylight.
the class ConcurrentClientsTest method createMockedMonitoringService.
public static NetconfMonitoringService createMockedMonitoringService() {
NetconfMonitoringService monitoring = mock(NetconfMonitoringService.class);
final SessionListener sessionListener = mock(SessionListener.class);
doNothing().when(sessionListener).onSessionUp(any(NetconfServerSession.class));
doNothing().when(sessionListener).onSessionDown(any(NetconfServerSession.class));
doNothing().when(sessionListener).onSessionEvent(any(SessionEvent.class));
doReturn((AutoCloseable) () -> {
}).when(monitoring).registerCapabilitiesListener(any(NetconfMonitoringService.CapabilitiesListener.class));
doReturn(sessionListener).when(monitoring).getSessionListener();
doReturn(new CapabilitiesBuilder().setCapability(Collections.emptyList()).build()).when(monitoring).getCapabilities();
return monitoring;
}
Aggregations