ServerService { public List<String> getAllServers() { List<String> result = jobNodeStorage.getJobNodeChildrenKeys(ServerNode.ROOT); Collections.sort(result); return result; } ServerService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void clearPreviousServerStatus(); void persistServerOnline(); void clearJobTriggerStatus(); void clearJobPausedStatus(); boolean isJobPausedManually(); void processServerShutdown(); void updateServerStatus(final ServerStatus status); void removeServerStatus(); List<String> getAllServers(); List<String> getAvailableServers(); boolean isAvailableServer(final String ip); boolean isLocalServerDisabled(); boolean isLocalhostServerReady(); void persistProcessSuccessCount(final int processSuccessCount); void persistProcessFailureCount(final int processFailureCount);  }
@Test public void assertGetAllServers() { when(jobNodeStorage.getJobNodeChildrenKeys("servers")).thenReturn(Arrays.asList("host0", "host2", "host1", "host3")); assertThat(serverService.getAllServers(), is(Arrays.asList("host0", "host1", "host2", "host3"))); verify(jobNodeStorage).getJobNodeChildrenKeys("servers"); }