### Question:
S3FileSystemProvider implements FileSystemProvider { @Nonnull @VisibleForTesting Optional<AWSCredentialsProvider> getBasicCredentialsProvider(@Nonnull final URI uri, @Nonnull final Configuration conf) { String scheme = uri.getScheme(); final String accessKeyProperty = "fs." + scheme + ".awsAccessKeyId"; final String accessKey = conf.get(accessKeyProperty); final String secretKeyProperty = "fs." + scheme + ".awsSecretAccessKey"; final String secretKey = conf.get(secretKeyProperty); if (accessKey != null && secretKey != null) { return Optional.of(new BasicAWSCredentialsProvider(accessKey, secretKey)); } else if (secretKey != null) { throw new CatalogException("catalog.fs.s3.missingAccessKeyProperty", accessKeyProperty); } else if (accessKey != null) { throw new CatalogException("catalog.fs.s3.missingSecretAccessKeyProperty", secretKeyProperty); } else { log.info("AWS Access Key ID and Secret Access Key must be specified by setting the {} and {} properties (respectively).", accessKeyProperty, secretKeyProperty); return Optional.empty(); } }  @Nonnull @Override List<DataSetFile> listFiles(@Nonnull final Path path, @Nonnull final Configuration conf); @Override boolean supportsPath(@Nonnull final Path path);  }### Answer:
@Test @SuppressWarnings("squid:S3655") public void getBasicCredentialsProvider() { final S3FileSystemProvider provider = new S3FileSystemProvider(); Assert.assertFalse("Expected empty credentials", provider.getBasicCredentialsProvider(S3N, new Configuration(false)).isPresent()); final Configuration conf = new Configuration(false); conf.set("fs.s3n.awsAccessKeyId", "S3N_ACCESS_KEY"); conf.set("fs.s3n.awsSecretAccessKey", "S3N_SECRET_KEY"); final Optional<AWSCredentialsProvider> credentialsProvider = provider.getBasicCredentialsProvider(S3N, conf); Assert.assertTrue("Expected URI credentials", credentialsProvider.isPresent()); final AWSCredentials credentials = credentialsProvider.get().getCredentials(); Assert.assertEquals("S3N_ACCESS_KEY", credentials.getAWSAccessKeyId()); Assert.assertEquals("S3N_SECRET_KEY", credentials.getAWSSecretKey()); }