FileSystemIncrementalBackupLocation implements IncrementalBackupLocation { @Override public Map<String, File> getBackedUpOplogs(DiskStore diskStore) throws IOException { File checkedBaselineDir = checkBaseline(diskStore); if (checkedBaselineDir == null) { return Collections.emptyMap(); } Collection<File> baselineOplogFiles = getBackedUpOplogs(checkedBaselineDir, diskStore); baselineOplogFiles.addAll(getPreviouslyBackedUpOpLogs(checkedBaselineDir)); return TransformUtils.transformAndMap(baselineOplogFiles, getFileNameTransformer()); } FileSystemIncrementalBackupLocation(File backupLocationDir, String memberId); @Override Map<String, File> getBackedUpOplogs(DiskStore diskStore);  }
@Test public void testNonExistentBackupLocation() throws IOException { DiskStore diskstore = mock(DiskStore.class); File nonExistingDir = Paths.get("nonexistent").toFile(); FileSystemIncrementalBackupLocation backupLocation = new FileSystemIncrementalBackupLocation(nonExistingDir, "member1"); assertThat(backupLocation.getBackedUpOplogs(diskstore)).isEmpty(); }
@Test public void testNonExistentMemberBackupLocation() throws IOException { File backupLocation = tempDir.newFolder("backup"); DiskStore diskstore = mock(DiskStore.class); FileSystemIncrementalBackupLocation fileBackupLocation = new FileSystemIncrementalBackupLocation(backupLocation, "member1"); assertThat(fileBackupLocation.getBackedUpOplogs(diskstore)).isEmpty(); }