@Test public void testGetShortFilePathsShouldReturnListWithOneElementWhenTargetFolderContainsOneFile() { given(fileFactory.createFile(PATH)).willReturn(file); List<File> fileList = new ArrayList<File>(); fileList.add(file); given(fileUtils.listFiles(file)).willReturn(fileList); given(file.toString()).willReturn(PATH + "\\" + SHORT_PATH); List<String> actual = underTest.getShortFilePaths(PATH); Assert.assertEquals(actual.get(0), SHORT_PATH); }
public List<String> getShortFilePaths(final String path) { List<String> result = new ArrayList<>(); File folder = fileFactory.createFile(path); Collection<File> files = fileUtils.listFiles(folder); for (File file : files) { result.add(getSimpleName(path, file)); } return result; }
FilePathReader { public List<String> getShortFilePaths(final String path) { List<String> result = new ArrayList<>(); File folder = fileFactory.createFile(path); Collection<File> files = fileUtils.listFiles(folder); for (File file : files) { result.add(getSimpleName(path, file)); } return result; } }
FilePathReader { public List<String> getShortFilePaths(final String path) { List<String> result = new ArrayList<>(); File folder = fileFactory.createFile(path); Collection<File> files = fileUtils.listFiles(folder); for (File file : files) { result.add(getSimpleName(path, file)); } return result; }  }
FilePathReader { public List<String> getShortFilePaths(final String path) { List<String> result = new ArrayList<>(); File folder = fileFactory.createFile(path); Collection<File> files = fileUtils.listFiles(folder); for (File file : files) { result.add(getSimpleName(path, file)); } return result; }  List<String> getFilePaths(final String path); List<String> getShortFilePaths(final String path); }
FilePathReader { public List<String> getShortFilePaths(final String path) { List<String> result = new ArrayList<>(); File folder = fileFactory.createFile(path); Collection<File> files = fileUtils.listFiles(folder); for (File file : files) { result.add(getSimpleName(path, file)); } return result; }  List<String> getFilePaths(final String path); List<String> getShortFilePaths(final String path);  }