@Test public void testNullInterfaces() { reset(interfaceService); interfaceService.addListener(anyObject(InterfaceListener.class)); expectLastCall().anyTimes(); expect(interfaceService.getInterfaces()).andReturn( Sets.newHashSet()).anyTimes(); expect(interfaceService.getInterfacesByPort(s2Eth1)) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getInterfacesByPort(s1Eth1)) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.10.101"))) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.10.1"))) .andReturn(null).anyTimes(); expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.20.101"))) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.20.1"))) .andReturn(null).anyTimes(); expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.30.101"))) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.30.1"))) .andReturn(null).anyTimes(); expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.40.101"))) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.40.1"))) .andReturn(null).anyTimes(); expect(interfaceService.getInterfacesByIp(IpAddress.valueOf("192.168.50.101"))) .andReturn(Collections.emptySet()).anyTimes(); expect(interfaceService.getMatchingInterface(IpAddress.valueOf("192.168.50.1"))) .andReturn(null).anyTimes(); replay(interfaceService); reset(intentSynchronizer); replay(intentSynchronizer); peerConnectivityManager.start(); verify(intentSynchronizer); }
public void start() { configService.addListener(configListener); interfaceService.addListener(interfaceListener); setUpConnectivity(); }
PeerConnectivityManager { public void start() { configService.addListener(configListener); interfaceService.addListener(interfaceListener); setUpConnectivity(); } }
PeerConnectivityManager { public void start() { configService.addListener(configListener); interfaceService.addListener(interfaceListener); setUpConnectivity(); } PeerConnectivityManager(ApplicationId appId,
                                   IntentSynchronizationService intentSynchronizer,
                                   NetworkConfigService configService,
                                   ApplicationId routerAppId,
                                   InterfaceService interfaceService); }
PeerConnectivityManager { public void start() { configService.addListener(configListener); interfaceService.addListener(interfaceListener); setUpConnectivity(); } PeerConnectivityManager(ApplicationId appId,
                                   IntentSynchronizationService intentSynchronizer,
                                   NetworkConfigService configService,
                                   ApplicationId routerAppId,
                                   InterfaceService interfaceService); void start(); void stop(); }
PeerConnectivityManager { public void start() { configService.addListener(configListener); interfaceService.addListener(interfaceListener); setUpConnectivity(); } PeerConnectivityManager(ApplicationId appId,
                                   IntentSynchronizationService intentSynchronizer,
                                   NetworkConfigService configService,
                                   ApplicationId routerAppId,
                                   InterfaceService interfaceService); void start(); void stop();  }