Search in sources :

Example 1 with SessionListener

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;
}
Also used : NetconfMonitoringService(org.opendaylight.netconf.api.monitoring.NetconfMonitoringService) SessionEvent(org.opendaylight.netconf.api.monitoring.SessionEvent) CapabilitiesBuilder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder) SimpleNetconfClientSessionListener(org.opendaylight.netconf.client.SimpleNetconfClientSessionListener) SessionListener(org.opendaylight.netconf.api.monitoring.SessionListener)

Aggregations

NetconfMonitoringService (org.opendaylight.netconf.api.monitoring.NetconfMonitoringService)1 SessionEvent (org.opendaylight.netconf.api.monitoring.SessionEvent)1 SessionListener (org.opendaylight.netconf.api.monitoring.SessionListener)1 SimpleNetconfClientSessionListener (org.opendaylight.netconf.client.SimpleNetconfClientSessionListener)1 CapabilitiesBuilder (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder)1