GameLogFile { public boolean readNextStep() { if (!openRead) { try { openRead(); } catch (FileNotFoundException e) { logger.warn("Requested game log file for player " + playerName + "does not exist", e); return false; } } try { currentLine = reader.readLine(); } catch (IOException e) { logger.warn("Unable to read game log file:" + getPath() + " for player: " + playerName + ". Replay will stop silently.", e); currentLine = null; return false; } return currentLine != null; } GameLogFile(ServiceConfiguration configuration, String playerName, String timeStamp); void close(); void log(String request, String response); boolean readNextStep(); String getPath(); Figure.Type getCurrentFigure(); String getCurrentResponse(); String getTimeStamp(); String getPlayerName(); List<Figure.Type> getFutureFigures();  }
@Test public void shouldBeFalseHasNextWhenEmptyFile() throws IOException { createEmptyLogFile(); assertFalse(logFile.readNextStep()); }
@Test public void shouldBeFalseHasNextWhenFileNotExists() throws IOException { assertFalse(logFile.readNextStep()); }