### Question:
S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired  S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3DataManipulator newInstance(Path replicaLocation, Map<String, Object> copierOptions); @Override boolean supportsSchemes(String sourceScheme, String replicaScheme);  }### Answer:
@Test public void checkSupportsS3ToS3() { sourceLocation = new Path(s3Path); replicaLocation = new Path(s3Path); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkSupportsHdfsToS3UpperCase() { sourceLocation = new Path(s3Path.toUpperCase()); replicaLocation = new Path(s3Path.toUpperCase()); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportHdfs() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(hdfsPath); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportHdfsToS3() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(s3Path); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); }
@Test public void checkDoesntSupportS3ToHdfs() { sourceLocation = new Path(s3Path); replicaLocation = new Path(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)); }