@Test public void getPowerButtonsToPressReturnsTheServersThatAreOff() { List<Host> hostsToPress = allServersOnStrategy.getPowerButtonsToPress(getClusterStateWithSomeServersOff()); List<String> hostnamesOffServers = new ArrayList<>(); for (Host host: hostsToPress) { hostnamesOffServers.add(host.getHostname()); } assertTrue(hostnamesOffServers.contains("host3")); assertTrue(hostnamesOffServers.contains("host4")); }
@Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getTurnedOffHosts(); }
AllServersOnStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getTurnedOffHosts(); } }
AllServersOnStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getTurnedOffHosts(); } AllServersOnStrategy(); }
AllServersOnStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getTurnedOffHosts(); } AllServersOnStrategy(); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState); }
AllServersOnStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getTurnedOffHosts(); } AllServersOnStrategy(); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState);  }