@Test public void regularSwitchConnectSequence() { SwitchMonitorService subject = makeSubject(); SwitchInfoData swAdd = new SwitchInfoData(SWITCH_ALPHA, SwitchChangeType.ADDED); subject.handleStatusUpdateNotification(swAdd, REGION_ALPHA); verify(carrier).regionUpdateNotification( eq(new RegionMappingAdd(swAdd.getSwitchId(), REGION_ALPHA, false))); verifyNoMoreInteractions(carrier); SwitchInfoData swActivate = makeSwitchActivateNotification(swAdd.getSwitchId()); subject.handleStatusUpdateNotification(swActivate, REGION_ALPHA); verify(carrier).switchStatusUpdateNotification(eq(swActivate.getSwitchId()), eq(swActivate)); verify(carrier).regionUpdateNotification( eq(new RegionMappingSet(swActivate.getSwitchId(), REGION_ALPHA, true))); verifyNoMoreInteractions(carrier); }
public void handleStatusUpdateNotification(SwitchInfoData notification, String region) { SwitchMonitorEntry entry = lookupOrCreateSwitchMonitor(notification.getSwitchId()); entry.handleStatusUpdateNotification(notification, region); }
SwitchMonitorService { public void handleStatusUpdateNotification(SwitchInfoData notification, String region) { SwitchMonitorEntry entry = lookupOrCreateSwitchMonitor(notification.getSwitchId()); entry.handleStatusUpdateNotification(notification, region); } }
SwitchMonitorService { public void handleStatusUpdateNotification(SwitchInfoData notification, String region) { SwitchMonitorEntry entry = lookupOrCreateSwitchMonitor(notification.getSwitchId()); entry.handleStatusUpdateNotification(notification, region); } SwitchMonitorService(Clock clock, SwitchMonitorCarrier carrier); }
SwitchMonitorService { public void handleStatusUpdateNotification(SwitchInfoData notification, String region) { SwitchMonitorEntry entry = lookupOrCreateSwitchMonitor(notification.getSwitchId()); entry.handleStatusUpdateNotification(notification, region); } SwitchMonitorService(Clock clock, SwitchMonitorCarrier carrier); void handleTimerTick(); void handleRegionOfflineNotification(String region); void handleStatusUpdateNotification(SwitchInfoData notification, String region); void handleNetworkDumpResponse(NetworkDumpSwitchData response, String region); }
SwitchMonitorService { public void handleStatusUpdateNotification(SwitchInfoData notification, String region) { SwitchMonitorEntry entry = lookupOrCreateSwitchMonitor(notification.getSwitchId()); entry.handleStatusUpdateNotification(notification, region); } SwitchMonitorService(Clock clock, SwitchMonitorCarrier carrier); void handleTimerTick(); void handleRegionOfflineNotification(String region); void handleStatusUpdateNotification(SwitchInfoData notification, String region); void handleNetworkDumpResponse(NetworkDumpSwitchData response, String region);  }