ConsolidationScoredPreferenceForSmallHosts extends ConsolidationAlgorithmBase { @Override public List<HostResources> rankHostToPowerOff(List<HostResources> idleHosts) { List<HostResources> idleHostSorted = cloneListOfHosts(idleHosts); sortHostsDownwardScore(setEachHostScore(idleHostSorted)); return idleHostSorted; }  @Override List<HostResources> rankHosts(List<HostResources> hostsList); @Override List<HostResources> rankHostToPowerOff(List<HostResources> idleHosts);  }
@Test public void rankHostToPowerOffTest() { List<HostResources> hosts = createHosts(); Mockito.doReturn(hosts).when(spyAlgorithm).setEachHostScore(Mockito.anyListOf(HostResources.class)); Mockito.doNothing().when(spyAlgorithm).sortHostsDownwardScore(hosts); spyAlgorithm.rankHostToPowerOff(hosts); InOrder inOrder = Mockito.inOrder(spyAlgorithm); inOrder.verify(spyAlgorithm).cloneListOfHosts(Mockito.anyListOf(HostResources.class)); inOrder.verify(spyAlgorithm).setEachHostScore(Mockito.anyListOf(HostResources.class)); inOrder.verify(spyAlgorithm).sortHostsDownwardScore(Mockito.anyListOf(HostResources.class)); }