@Test
@SuppressWarnings("squid:S3655")
public void getCustomCredentialsProvider() {

    // Test empty configuration
    final S3FileSystemProvider provider = new S3FileSystemProvider();
    Assert.assertFalse("Expected empty credentials", provider.getCustomCredentialsProvider(S3N, new Configuration(false)).isPresent());
    // Test with custom credentials provider
    final Configuration conf = new Configuration(false);
    conf.setClass("fs.s3.customAWSCredentialsProvider", EnvironmentVariableCredentialsProvider.class, AWSCredentialsProvider.class);
    final Optional<AWSCredentialsProvider> credentials = provider.getCustomCredentialsProvider(S3N, conf);
    Assert.assertTrue("Expected custom credentials", credentials.isPresent());
    Assert.assertTrue("Expected EnvironmentVariableCredentialsProvider", credentials.get() instanceof EnvironmentVariableCredentialsProvider);
}