### Question:
FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try { if (fileSystem == null) { fileSystem = path.getFileSystem(hiveConf); } if (fileSystem.exists(path)) { result.add(path); } else { LOG .warn("Source path '{}' does not exist skipping it for replication." + " WARNING: this means there is a partition in Hive that does not have a corresponding folder in" + " source file store, check your table and data.", path); } } catch (IOException e) { LOG.warn("Exception while checking path, skipping path '{}', error {}", path, e); } } return result; } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Override Path getTableLocation(); @Override List<Path> getPartitionLocations(); @Override void cleanUpLocations(); @Override Path getPartitionSubPath(Path partitionLocation);  }### Answer:
@Test public void getPartitionLocations() { List<Path> paths = Lists.newArrayList(path, missingPath); when(sourceLocationManager.getPartitionLocations()).thenReturn(paths); List<Path> filteredPaths = filterMissingPartitionsLocationManager.getPartitionLocations(); List<Path> expected = Lists.newArrayList(path); assertThat(filteredPaths, is(expected)); }
@Test public void getPartitionLocationsExceptionThrowingPathIsSkipped() { List<Path> paths = Lists.newArrayList(path, exceptionThrowingPath); when(sourceLocationManager.getPartitionLocations()).thenReturn(paths); List<Path> filteredPaths = filterMissingPartitionsLocationManager.getPartitionLocations(); List<Path> expected = Lists.newArrayList(path); assertThat(filteredPaths, is(expected)); }