@Test public void testGetLogContentWhenErrorOccursShouldReturnErrorMessage() throws IOException { Collection<File> files = new ArrayList<>(); String fileName = "a"; File file = new File("a"); files.add(file); given(fileUtils.getFilesWithExtension(LOG_PATH, LOG_EXTENSION)).willReturn(files); given(fileUtils.readFileToString(file)).willThrow(new IOException()); String result = underTest.getLogContent(fileName); assertEquals(ERROR_MESSAGE, result); }
public String getLogContent(final String fileName) { Collection<File> files = getLogFiles(LOG_PATH); File file = findFile(fileName, files); return getContent(file); }
LogFileProvider { public String getLogContent(final String fileName) { Collection<File> files = getLogFiles(LOG_PATH); File file = findFile(fileName, files); return getContent(file); } }
LogFileProvider { public String getLogContent(final String fileName) { Collection<File> files = getLogFiles(LOG_PATH); File file = findFile(fileName, files); return getContent(file); }  }
LogFileProvider { public String getLogContent(final String fileName) { Collection<File> files = getLogFiles(LOG_PATH); File file = findFile(fileName, files); return getContent(file); }  Collection<String> getLogFileNames(); String getLogContent(final String fileName); }
LogFileProvider { public String getLogContent(final String fileName) { Collection<File> files = getLogFiles(LOG_PATH); File file = findFile(fileName, files); return getContent(file); }  Collection<String> getLogFileNames(); String getLogContent(final String fileName);  }