### Question:
S3MapreduceDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return !S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired  S3MapreduceDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object> copierOptions); @Override boolean supportsSchemes(String sourceScheme, String replicaScheme);  }### Answer:
@Test public void checkSupportsHdfsToS3() { sourceLocation = hdfsPath; replicaLocation = s3Path; sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportS3() { sourceLocation = s3Path; replicaLocation = s3Path; sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportHdfsToHdfs() { sourceLocation = hdfsPath; replicaLocation = hdfsPath; sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportRandomPaths() { sourceLocation = new Path("<path>"); replicaLocation = new Path("<path>"); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }