aldettinger commented on code in PR #4474:
URL: https://github.com/apache/camel-quarkus/pull/4474#discussion_r1094579690


##########
integration-tests-support/aws2/src/main/java/org/apache/camel/quarkus/test/support/aws2/Aws2Helper.java:
##########
@@ -0,0 +1,35 @@
+package org.apache.camel.quarkus.test.support.aws2;
+
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+import software.amazon.awssdk.core.exception.SdkClientException;
+
+public class Aws2Helper {
+
+    public static final String UNABLE_TO_LOAD_CREDENTIALS_MSG = "Unable to 
load credentials";
+
+    public static boolean isDefaultCredentialsProviderDefinedOnSystem() {
+        try {
+            DefaultCredentialsProvider.create().resolveCredentials();
+        } catch (Exception e) {
+            //if message starts with "Unable to load credentials", allow 
testing
+            if (e instanceof SdkClientException && e.getMessage() != null
+                    && 
e.getMessage().startsWith(UNABLE_TO_LOAD_CREDENTIALS_MSG)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static void setAwsSysteCredentials(String accessKey, String 
secretKey) {

Review Comment:
   small typo here ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to