@Test public void getPowerButtonsToPressReturnsTheServersThatAreOnAndDoNotContainVms() { List<Host> hostsToPress = justInTimeStrategy.getPowerButtonsToPress( getClusterStateWithSomeOnServersWithoutVms()); List<String> hostNamesPowerButtonsToPress = new ArrayList<>(); for (Host host: hostsToPress) { hostNamesPowerButtonsToPress.add(host.getHostname()); } assertTrue(hostNamesPowerButtonsToPress.contains("host3")); assertTrue(hostNamesPowerButtonsToPress.contains("host4")); }
@Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); }
JustInTimeStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); } }
JustInTimeStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); } JustInTimeStrategy(); }
JustInTimeStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); } JustInTimeStrategy(); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState); }
JustInTimeStrategy implements PowerButtonStrategy { @Override public List<Host> getPowerButtonsToPress(ClusterState clusterState) { return clusterState.getHostsWithoutVmsAndSwitchedOn(); } JustInTimeStrategy(); @Override List<Host> getPowerButtonsToPress(ClusterState clusterState);  }