@Test public void multipleConnections() { SwitchReadWriteConnectMonitor subject = makeSubject(SWITCH_ALPHA); SwitchInfoData connectEvent = makeConnectNotification(SWITCH_ALPHA); subject.handleSwitchStatusNotification(connectEvent, REGION_A); verify(carrier, times(1)) .switchStatusUpdateNotification(eq(connectEvent.getSwitchId()), eq(connectEvent)); verify(carrier).regionUpdateNotification( eq(new RegionMappingSet(connectEvent.getSwitchId(), REGION_A, subject.isReadWriteMode()))); subject.handleSwitchStatusNotification(connectEvent, REGION_B); verify(carrier, times(1)) .switchStatusUpdateNotification(eq(connectEvent.getSwitchId()), eq(connectEvent)); verify(carrier, never()).regionUpdateNotification( eq(new RegionMappingSet(connectEvent.getSwitchId(), REGION_B, subject.isReadWriteMode()))); }
@Override protected boolean isReadWriteMode() { return true; }
SwitchReadWriteConnectMonitor extends SwitchConnectMonitor { @Override protected boolean isReadWriteMode() { return true; } }
SwitchReadWriteConnectMonitor extends SwitchConnectMonitor { @Override protected boolean isReadWriteMode() { return true; } SwitchReadWriteConnectMonitor(SwitchMonitorCarrier carrier, Clock clock, SwitchId switchId); }
SwitchReadWriteConnectMonitor extends SwitchConnectMonitor { @Override protected boolean isReadWriteMode() { return true; } SwitchReadWriteConnectMonitor(SwitchMonitorCarrier carrier, Clock clock, SwitchId switchId);  }
SwitchReadWriteConnectMonitor extends SwitchConnectMonitor { @Override protected boolean isReadWriteMode() { return true; } SwitchReadWriteConnectMonitor(SwitchMonitorCarrier carrier, Clock clock, SwitchId switchId);   }