NetconfConnectionStateProvider implements DeviceStateProvider { @Override public void deviceAdded(String deviceName) { Device device = m_deviceManager.getDevice(deviceName); if (device.getDeviceManagement().getDeviceConnection().getConnectionModel().equals(CALL_HOME)) { m_cm.dropNewDeviceConnection(device.getDeviceManagement().getDeviceConnection().getDuid()); } } NetconfConnectionStateProvider(DeviceManager deviceManager, NetconfConnectionManager cm); void init(); @Override void deviceAdded(String deviceName); @Override void deviceRemoved(String deviceName); void destroy(); static final String CONNECTION_STATE; static final String CALL_HOME; }
@Test public void testCallHomeNewDeviceConnectionIsClosedWhenDeviceIsAdded() { verify(m_cm, never()).dropNewDeviceConnection(anyString()); m_provider.deviceAdded("callHomeDevice-1"); verify(m_cm).dropNewDeviceConnection("callHomeDevice-1"); }