VersionedFileFactory { public List<VersionedFile> createVersionedFilesFrom(File parent) { List<VersionedFile> versionedFiles = new ArrayList<VersionedFile>(); for (File file : parent.listFiles()) { String versionAsString = file.getName(); if (!hasMarkerFile(file)) { Version version = new VersionFactory().createVersionFromString(versionAsString); versionedFiles.add(new VersionedFile(version, file)); } } return versionedFiles; }  List<VersionedFile> createVersionedFilesFrom(File parent);  }
@Test public void doesNotListVersionsWhereAnUpdateIsInProgress() throws Exception { folder.newFolder("4.0.0"); File v401 = folder.newFolder("4.0.1"); InstallationUtil.createMarkerFile(v401); List<VersionedFile> versionedFiles = new VersionedFileFactory().createVersionedFilesFrom(folder.getRoot()); assertThat(versionedFiles.size(), is(1)); }