|
@@ -187,6 +187,23 @@ public class TestS3AAWSCredentialsProvider extends AbstractS3ATestBase {
|
|
assertCredentialProviders(expectedClasses, list2);
|
|
assertCredentialProviders(expectedClasses, list2);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void testNonSdkExceptionConversion() throws Throwable {
|
|
|
|
+ // Create a mock credential provider that throws a non-SDK exception
|
|
|
|
+ AwsCredentialsProvider mockProvider = () -> {
|
|
|
|
+ throw new RuntimeException("Test credential error");
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // Create the provider list with our mock provider
|
|
|
|
+ AWSCredentialProviderList providerList =
|
|
|
|
+ new AWSCredentialProviderList(Collections.singletonList(mockProvider));
|
|
|
|
+
|
|
|
|
+ // Attempt to get credentials, which should trigger the exception
|
|
|
|
+ intercept(NoAuthWithAWSException.class,
|
|
|
|
+ "No AWS Credentials provided",
|
|
|
|
+ () -> providerList.resolveCredentials());
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void testDefaultChainNoURI() throws Exception {
|
|
public void testDefaultChainNoURI() throws Exception {
|
|
Configuration conf = new Configuration(false);
|
|
Configuration conf = new Configuration(false);
|