@Test public void assertIsLocalhostServerReadyWhenServerCrashed() { when(jobNodeStorage.isJobNodeExisted("servers/mockedIP/status")).thenReturn(false); assertFalse(serverService.isLocalhostServerReady()); verify(localHostService).getIp(); verify(jobNodeStorage).isJobNodeExisted("servers/mockedIP/status"); }
public boolean isLocalhostServerReady() { String ip = localHostService.getIp(); return isAvailableServer(ip) && ServerStatus.READY.name().equals(jobNodeStorage.getJobNodeData(ServerNode.getStatusNode(ip))); }
ServerService { public boolean isLocalhostServerReady() { String ip = localHostService.getIp(); return isAvailableServer(ip) && ServerStatus.READY.name().equals(jobNodeStorage.getJobNodeData(ServerNode.getStatusNode(ip))); } }
ServerService { public boolean isLocalhostServerReady() { String ip = localHostService.getIp(); return isAvailableServer(ip) && ServerStatus.READY.name().equals(jobNodeStorage.getJobNodeData(ServerNode.getStatusNode(ip))); } ServerService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); }
ServerService { public boolean isLocalhostServerReady() { String ip = localHostService.getIp(); return isAvailableServer(ip) && ServerStatus.READY.name().equals(jobNodeStorage.getJobNodeData(ServerNode.getStatusNode(ip))); } ServerService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void clearPreviousServerStatus(); void persistServerOnline(); 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 isLocalhostServerReady(); void persistProcessSuccessCount(final int processSuccessCount); void persistProcessFailureCount(final int processFailureCount); }
ServerService { public boolean isLocalhostServerReady() { String ip = localHostService.getIp(); return isAvailableServer(ip) && ServerStatus.READY.name().equals(jobNodeStorage.getJobNodeData(ServerNode.getStatusNode(ip))); } ServerService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void clearPreviousServerStatus(); void persistServerOnline(); 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 isLocalhostServerReady(); void persistProcessSuccessCount(final int processSuccessCount); void persistProcessFailureCount(final int processFailureCount);  }