@Test public void disconnectOneOfOneConnections() { SwitchReadWriteConnectMonitor subject = makeSubject(SWITCH_ALPHA); SwitchInfoData connectEvent = makeConnectNotification(SWITCH_ALPHA); subject.handleSwitchStatusNotification(connectEvent, REGION_A); verify(carrier).switchStatusUpdateNotification(eq(connectEvent.getSwitchId()), eq(connectEvent)); verify(carrier).regionUpdateNotification( eq(new RegionMappingSet(connectEvent.getSwitchId(), REGION_A, subject.isReadWriteMode()))); Instant now = clock.adjust(Duration.ofSeconds(1)); Assert.assertTrue(subject.isAvailable()); SwitchInfoData disconnectEvent = makeDisconnectNotification(connectEvent.getSwitchId()); subject.handleSwitchStatusNotification(disconnectEvent, REGION_A); verify(carrier).switchStatusUpdateNotification( eq(disconnectEvent.getSwitchId()), ArgumentMatchers.eq(disconnectEvent)); Assert.assertFalse(subject.isAvailable()); Assert.assertEquals(now, subject.getBecomeUnavailableAt()); }
@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);   }