ConsolidationAlgorithmBase extends ClusterManagementDummyAlgorithm { @Override public final boolean canPowerOffHost(HostResources hostToPowerOff, CloudResources cloudResources) { if(canHeuristicShutdownHost){ return internalCanPowerOffHost(hostToPowerOff, cloudResources); } return false; }  @Override int getClusterIntervalBetweenConsolidation(); @Override Map<Long, HostResources> mapVMsToHost(List<HostResources> rankedHosts); boolean canMigrateVmToHost(VmResources vm, HostResources host); void updateHostUsedResources(VmResources vm, HostResources host); @Override final boolean canPowerOffHost(HostResources hostToPowerOff, CloudResources cloudResources); @Override final boolean canPowerOffAnotherHostInCloud(CloudResources cloudResources); @Override boolean canHeuristicShutdownHosts();  }
@Test public void canPowerOffHostTest() { HostResources host = createHost(2, 1000l, 0l, 1000l, 0l); CloudResources cloud = new CloudResources(null, 0, 0, 0, 0, 0); spyAlgorithm.canPowerOffHost(host, cloud); Mockito.verify(spyAlgorithm).internalCanPowerOffHost(host, cloud); }